Replies: 1 comment
-
Yes, this could be interesting, however, I would make the transport layer configurable, so that you can also send out events over RTT, UART, CAN. There is a similiar, but more generic way: Offline formatting like defmt, where each format string gets a unique ID and the arguments are passed as binary, but can be formatted properly on the receiver. I would prefer the offline formatter, since that's more generic and can also be used for event tracking. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Does a simple event recorder have a interest in MODM. Is has very low impact on performance and code size compared to traditional logging. It's only a simple circular buffer of type std::uintptr_t and everything is defined in a single header file. The power full magic lies in a Python GDB script which implements a
evr-print
command, it parses the header file and translates the binary data to a human readable output directly from GDB.Every event is simply defined in enums and a struct. They can have from 0 to 7 arguments and they are automatically cast'ed in a variadic template. All event id's consists of id, group, type and argument count combined together in a uintptr_t. All trace calls can be turn off and optimized away without changing the code.
It has really helped me in my project and gives a great overview of a running program, but i will not blindly implement it in MODM, GDB with different embedded python versions sucks and I fear it will give some troubles. If it has interest it could start as a standalone project and evolve from there. I got the idea from CMSIS RTOS2 they have implemented a similar solution i C for their IDE.
Example on output:
Beta Was this translation helpful? Give feedback.
All reactions