 Ok. Vous pouvez commencer. Je peux commencer. En français donc. So I did a talk today and I forgot there was a capital for English and French. There was an error in the office and I didn't know there was a capital in English. When you put English speaker and French speaker you need a capital. I learned it today. Ok. So I will try to talk about Ftrace. And basically I am a French Linux developer, a writer and teacher. I am a CTO for a French company working on party on embedded systems. It's quite a big company in open source. But we have about 70 people working on embedded systems. It's called SMILE ECS. SMILE is the main company ECS, the department. And I wrote a book, several books about embedded Linux. And the last one, Linux embarqué in French is embedded Linux. And the last one was available in the end of the last year. For Christmas. If you wait people you can offer out my book. So Ftrace is the official tracer for the Linux kernel. There are several tracers in the Linux kernel. The first one, one of the first one was LTT. But LTT was not mainline. I don't think it's mainline today. So Ftrace is available since 2.6.31. And it's main, mostly developed by Steven Rostead from Red Hat. And Steven left Red Hat some months ago. He's working for VMware today. And he's a developer for Pre-M30. Which is quite close to Ftrace. Because you need to measure some problems with Pre-M30. So there are lots of features for tracing. You can trace, of course, you can trace functions. You can trace events and latency. It's not a debugger. But it's a kind of provider. So I say the debug application with Ftrace. But it's not really a debugger. It's available in most of standard distribution. For example, on my Ubuntu, you can use Ftrace. I will show you. And it's based on DebugFS. If you want to activate, if you compile your kernel by yourself and activate Ftrace or deactivate if you want to, you have to access to kernel hacking tracers. So for example, you have to mount, if it's not done, you have to mount the DebugFS on C's kernel debug. And on C's kernel debug, you have an entry tracing. And you have to access as route. And you can see all the files, the virtual files to access the Ftrace system. So there are some important files put in bold as tracers, which is the result of Ftrace. Available events and available tracers. And a very important file is tracing on, which is a switch for activating or desactivating Ftrace. And this is on my Ubuntu, it is default to one. So you should put NOP to the current tracer. Otherwise you will trust everything. And you will get a Commodore C XT64 inside of a PC. It's a code for Steven Roestat. I'm not a author. So the procedure is quite simple. You set a tracer and a filter. For example, wakeupRT. You enable tracing, you run a program. For example, hackbench, which is a program to generate load on the system. You disable the tracing and you can get the result. For example, tracing makes latency. I will say, but there is a solution. If you use an embedded system to run the tracer, of course on the system, and to send the data to a remote PC, for example. Because of course it generates big files. For example, if I use the Octo or Bilroot on a Raspberry Pi, the file system is quite small. And so the files can be on the file system. Except on the boot partition, because it's bigger on the fat partition. I don't know why, but it's bigger. So it's better to send the file to the PC. There is an example, another example. For example, you want to trace the function of a simple driver. You set a function graph or function function graph is much better because it sets a graph of a sea-like graph. You set the filter. You trace only the function of myDriver3. You trace. And you know Toto for French. It's like a Fou and Bar for US. The story of Toto are very famous in France. So you send something to the driver and you can get the result from the trace. So if we have time, I can show you to have both a trace and a trace to the two ways of debugging the system. So one slide only on the basic internals. It's a bit surprising, but it's based on M-Count. It's a GCC profiler, just like in user space, but not really the same. When you compile with dashPG, you generate a call to M-Count at the beginning of the function. But there is lots of overhead. Overhead, there is a complex system embedded in the Linux kernel to replace M-Count to Knop instruction. There is a program to record the counts, etc., etc., to make it work very nice. But it's based on M-Count. M-Count is very old. It was available on Unix. Before Linux, I remember it was on Unix already. So there is a reference conference from Steven about the subject. So real-time programming, mostly it's based on periodic tasks. You can use, for example, POSIX timer for soft real-time, such as timer create, timer set-time, which will generate a signal, and the signal is not real-time, really real-time, not hard real-time, but it's a soft real-time. If you want to use the hard real-time and better results, you can use a clock nano-slip instead. For example, we will see a test with Preamp 30 at the end on the Raspberry Pi. You can get GPIO with a big pico-scope, actually a small oscilloscope. You can measure the system load and see the latency. So this is on a big urban block with one millisecond period. It's quite an adult system. One millisecond is not so short. But if you start some tasks, you will get this result, which is not very nice. It's with the Akbench tool from the RT test package. So if you want to test events in real-time with FTRAS, there is one way to use the SCADWAKUP event. So you set not to the current raster. It's actually not the same tracing way. We have tracing, so you put the SCADWAKUP to set event. You activate the trace. You start an example, a cyclic test, which is an example of the RT test package. We generate some threads with priority, etc. It's just like this. I can show you some demo. OK. Cyclic test. OK. So it's on a PC. So you will see the worst case on the right in microseconds. So it's just a periodic task with one millisecond period. OK. So it's quite simple to use. If you got a lot of slashes, because it's a bit boring to do echo, echo, echo, etc. And cut. You have a trace EMD command, which is in text mode written. It's a contribution to the project. And there is the kernel shark, which is based on GTK. It should be based on Qt in the future because Steven will work on ATV and more. He will work on upgrading the kernel shark at full time, he said. So it's a good idea because kernel shark is not that stable. And I don't like GUI a lot. So trace EMD, you use record and report. Record to record and report to display. And you create by default, you will create trace.dat file. You can create, use remote server access and listen on a PC. For example, you trace EMD listen with a number of ports. And on the target, on the number of systems, you say to send the data to the PC with the same program, to trace EMD record, main-e schedule backup. And you will see if you report on the PC, it's much better to do that on the PC and the file is on the PC. You play the file and you can check there is a one millisecond difference between each event. Well, it's only text mode. So you have to do better things for marketing people, for example. Okay. Or communication people, anything you want. Or your mother-in-law or anything. So for the text mode, you have to extract data. You can use GNU plot and you have static results. But GNU plot is very powerful. Kernel shark is dynamic and interactive, but it's a GUI and it's not that stable. As I say, it should be improved by Steven. And there are lots of buttons in Kernel shark and it's a button. So it's quite strange. Sometimes it works. It works, but I don't... Well, it works. But I don't understand really the result between two tries. So it's a bit strange. Well, something like that. So it's very complicated. With a lot of scholars, so we select the right CPU et you can drag with this fucking mouse. Of course, it's for a demo, so it doesn't work. Okay, it's best. Okay, okay, okay. You will see. Well. So here you can see, you can get the value. So there is a... Well. I don't like it, but it's fine for history. It should be better in the future. Okay, so... I did it in the TALIS today. Just add to slide about Kernel shark. You can see the timestamp here. And the next one with the next event, you will see the timestamp is updated about one millisecond, okay? It's nice because it's interactive. But... I will show that another way to work with ftrass. I will test preamp 30 on Raspberry Pi with one millisecond period, another one. But it's a program to generate activity on the GPIO. So there are two versions. The first one used on Opposite Timer and Signals. Seagalarm Signals. And the second one is based on nanosleep. So you can load the Raspberry Pi with the flute ping on anything you want. And there is several ways to test it. The first one records the event with a real-time program, and the second one records the event with a static priority. Okay? The second one uses SCAT-C4 with a high priority. So you can set the priority of a program on Linux by using CHRT. It's much better than writing the code inside the program. I did realize this three years ago. SCAT-C4F, a 1994 priority. And the last one, you do the same test with a real-time program. And you compare the result with a GNU plot. So the SCAT-C4F with a timer is awful. You have a line here, but with a kind of cloud around. It's not a cloud. Okay, this is not a point. This is a legend, okay? Because every time I show the picture, everybody says, why is the point here? It's a legend. Okay, the second test. It's SCAT-Other, but with clock nanosleep. It's not real-time, but it's not that bad. Okay? Because there is no signal. And the third one is a program 30 with SCAT-C4F and high priority. So it's the best. So I can show you maybe... I can show you some 10 minutes left, okay? For example, how to use ftrace directly. So SCAT-C4F. So on this kernel debug, you have lots of tracing subsystems. For example, you can trace... There should be a USB. You can trace a USB transfer, etc. It's not only for extras, of course. So tracing on. SCAT-Current Tracer. Okay? Fiction graph. Current Tracer. Fiction graph. It's better with graph. Okay? I will insert... It's always the same examples. Okay? It's a very simple driver. Which reads the... reads the data, put it in a buffer, and we send data. As you do. My directory. Okay? Okay? So you have the new functions. So I put my driver of 12. Because it's too... to take the 10 minutes. Oh. No, but... it's for sure. Actually, trace EMD is nice for tracing events. It is my opinion. Trace EMD is fine for tracing events when you want to record data. But I think this is better to trace a driver just to show the function call, etc. This is my opinion. This is not the same way to use F-Trace. So if you write a Toto again, it works only with Toto in France. Okay? You will see. I forgot to activate the tracer. Sorry. No, it's mine. So I put a function graph tracer. So there is a time of duration. If I change the tracer to function, it will be different. But it's quite the same. You have the caller and it's called by the VFS, etc. So now you can... you can display the content of the Toto file. Okay, so it's interesting if you have a driver and you want to check the timestamp for the calling. Okay, 5 minutes. So I will tell a story of Toto. So if you have any question, do you have any question? I would like to ask if the F-Trace is able to trace just a function at a point and as a point or something else. Can I trace something else in the functions themselves without the branches? Actually, you can put markers in F-Trace. There are lots of possibilities. I focus on real time. On site the code and you can see the marker. It's called trace marker. F-Trace marker. You can put a marker and then you will see the marker. I have some slide about it. If you want just to see it's in French but it would be fine. It's for the students. French question. Yeah. This one. F-Trace. You can do some things such as... You can use a trace pin car for example in your driver and then you will see the message in the tracer. So it's very interesting and in your function graph Vous pouvez utiliser le tracemarker. Et, pour exemple, dans le code d'utilisation de l'usage, vous pouvez mettre sur le marker le descripteur, avant nano, après nano. Et puis, vous verrez les commentaires dans le graphon de fonction. Donc, vous pouvez ajouter des choses et vous aider à voir ce qui se passe dans le kernel. FDNG ? LTTNG. LTTNG. Oh, c'est LTTNG. C'est un peu compliqué, en fait. Quand nous avons commencé à travailler en temps réel, avec ma compagnie, qui s'appelle OpenWide, nous avons commencé avec LTTNG parce que FDNG n'était pas disponible pour Airbus, pour les planes, pour tester les planes. Et nous avons switché à FDNG parce que LTTNG était très compliqué, ce n'est pas la mainline. Donc, vous devez prendre une version du kernel avec une version du patch. C'est beaucoup mieux d'utiliser les functionalités de mainline parce que ça fonctionne sur toutes les plateformes. C'est toujours la même interface. Je pense que c'est beaucoup mieux. Mais LTTNG était bien, mais c'était un peu difficile de set-up, comme vous pouvez le voir sur la picture. Est-ce que ça peut être un variable ? Le contexte ? La priorité ? Oui. Mais si c'est en temps réel, la priorité est statique. Ok, change. Quand vous êtes close à la fixation, ce qu'il faut concentrer c'est l'exécution du service. Vous ne voulez pas le service pour droguer parce que c'est la conception de la tracé. Donc, est-ce que vous pourrez droguer le service parce que c'est un contexte très fort pour avoir un contexte constrainable ? Tu veux dire qu'on regarde le tracé ? Oui. Vous pouvez faire tout ce que vous voulez. Mais quand vous commencez la tracé, vous commencez la tracé ce n'est pas un problème avec la tracé. C'est un problème avec la ligne de commande. Quand vous commencez la commande avec une priorité spécifique. Cette commande. C'est une priorité statique. Mais si vous voulez modifier la priorité vous devriez mettre le setting de la priorité dans le programme. Si vous voulez changer le programme. Mais avec CHRT c'est pour commencer un programme avec une priorité statique. Mais vous pouvez, bien sûr, c'est pas un programme avec Ftrace, c'est un programme c'est un problème avec le programme. Ou je ne comprends pas votre question. Non, non, je ne pense pas. Si il y a une modification de la priorité de la tracé dans le programme, Ftrace ne sera pas un problème. C'est par rapport à l'extrême BPF ? Je ne sais pas. Je sais que l'extrême BPF mais je ne l'ai pas utilisé. Donc je ne peux pas répondre à la question. Ftrace, vous pouvez utiliser un programme spatial par utilisant des tracé-marquures. C'est utilisé pour tracer les fonctions et les événements en temps réel. Ok ? Merci.