Hi All!
I have a first half-way useable version of my tracer up on github and thought I would post here since I have mentioned it a few times now.
I gave it the slightly annoying name of ‘Tonbandgerät’, which is german for tape recorder
They two main components are the embedded tracer that hooks into FreeRTOS, and a CLI tool written in rust that takes the binary traces and converts them into the native protobuffer format used by google’s/android’s online trace viewer “perfetto”.
Because this is intended for a course I help run at my university, I also built a small website that incorporates the converter compiled down to WASM and a simple web frontend to allow students to convert traces simply by copy-pasting (if they are in hex/base 64), or uploading them. The conversion then all happens client side and the website can automatically redirect to perfetto, displaying the trace with a single click of a button
You can find this website here:
https://schilk.co/Tonbandgeraet/
(Be gentle - I am not a web developer:) )
If you want to try it out, here is a dummy hex trace that you can copy-paste into the trace field before hitting “1-CLICK OPEN”:
Hopefully everything works, perfetto should opens, and you should see something like this:
I especially like how you can see priority-inheritance in action when task 2 first runs and gets its priority boosted. These are exactly the kind of details I hope my students will better grasp with this kind of visualization.
Unfortunately the perfetto UI is not amazing for organizing this kind of information, so the easiest way of looking at traces is by manually “pinning” the tracks you are interested in at the top.
I have also started documenting everything, which you can find here:
https://schilk.co/Tonbandgeraet/docs/index.html
This includes some basic usage information, but also some details on the inner workings like the trace format (Uses on a simple scheme based on COBS framing & varlen encoding, powered by a python code generator). It is by no means completed.
Current State of Tonbandgerät
I would consider it a minimum viable prototype. The basics work. There are some cool features
like a metadata buffer that tracks metadata events (stuff like task names) should they occur before tracing is started. It also has different backends, including a “streaming” and “snapshot” mode. A “post-mortem” mode is still WIP. To be fair I have not yet actually tried doing a “streaming” acquistion via something like RTT. At the moment I have just been filling a RAM buffer and then slowly dumping it via UART once it is full
I have also built most (all?) things with multi-core tracing in mind. In theory that should be working but I have not yet tested it yet.
Many things are not yet implemented (streambuffer/to-task notifs/event groups tracing), but all that should be fairly quick now that the “foundation” is finished.
It is based on FreeRTOS v10.3.1 for the stupid reason that that is what ships with STM32Cube and I did not want to only support the super latest version of FreeRTOS. Once my PRs are merged I plan to add support for that version with the required ifdef toggles. But for now I don’t want to keep updating my trace every time I change my mind about a tracing hook PR…
Next steps (including PRs)
I got it far enough that we can feasibly use it in “controlled” course exercises
Unfortunately I now have to stop working on this for a bit and deal with this pesky thing called studying for exams. I don’t exactly know when I will have the next big chunk of time to do significant work on this and the PRs but I am sure I will procrastinate find time to do little chunks of work here and there.
There is a section in the introduction of the documentation that I will (hopefully) keep update about the status of things.
Similarly, I will not have time at the moment to keep thinking about the big refactoring PR. Please feel free to have a good look and provide feedback there or on the forum, I will be sure to have a look when I have time again.
Please feel free to jump in and let me know if you think there is something that obviously makes no sense: I am always glad for feedback.
Thanks again for all your support and patience!