knurling-rs / defmt

Efficient, deferred formatting for logging on embedded systems
https://defmt.ferrous-systems.com/
Apache License 2.0
812 stars 74 forks source link

Provide mechanism to export defmt mappings from the ELF #854

Open ryan-summers opened 3 months ago

ryan-summers commented 3 months ago

There are a number of potential uses of defmt that don't actually require the ELF binary, such as:

Some external receiver is then responsible for decoding and formatting these values at a later time/date. Currently, this process requires an elf binary file that generated the defmt logs in the first place.

Being able to export the defmt mapping tables into some other format (i.e. TOML, JSON, YAML, etc.) would aid in the ability to write custom tools to process these logs after-the-fact.

ryan-summers commented 3 months ago

For reference, this table may be what we would want to dump

jonathanpallant commented 3 months ago

That sounds really interesting.

Is the symbol table sufficient (apologies, I should dig in and check to answer that, but I haven't yet)? IIRC the defmt strings are all JSON encoded symbol names that are easy to find from an objdump.