rokath / trice

🟢 super fast 🚀 and tiny 🐥 embedded device 𝘾 printf-like trace ✍ code, works also inside ⚡ interrupts ⚡ and real-time PC 💻 logging (trace ID visualization 👀)
MIT License
521 stars 46 forks source link

Why the file and line are not part of the til.json? #256

Closed liborw closed 2 years ago

rokath commented 2 years ago

Good point! In fact its a bit historical - file and line came in later as a quick fix. Some thoughts:

liborw commented 2 years ago

Thanks for clarification, I get the sharedIDs point, but the two firmware version is easily solved by two til.json i.e. different branch in a repository, same as you have to have two version of the file1.c to find the actual location...

The idea I'm working on is to save the data raw as they come from target and "play it" later for analysis, and then 4 bytes for each message are quite noticeable.

rokath commented 2 years ago

Please describe your use case a bit more in detail. Data logging into FLASH memory?

Data handling

Data reducing

Disadvantages

Possible Solution

liborw commented 2 years ago

The user case is a project that will run couple of hours, and log as much data as possible as these runs are not easy to perform, and then analyze the logged data, i.e. plots of some key values, etc. It was just an idea to decrease the size of the logged file.

Disadvantages: I still do not understand the problem with two til.json, as you still have two version of each file (the two firmware versions). Also I'm not sure how go implements dictionaries but I would guess that as long as the number of keys (iDs) is same the performance does not change much.

I'm not trying to push change, just thinking. Actually, currently I'm using just the firmware and pyocd to get the Trice messages through RTT out of the MCU and the processing them in python (online or offline), as I do not know go, so it was hard to modify it to mi purpose.

rokath commented 2 years ago

If data minimizing for recording really matters, check here: https://github.com/rokath/trice/blob/master/docs/TriceObsoleteEncodings.md#411-flex-short-sub-encoding - The FLEX encoding worked well and you can get away with 4 bytes per Trice in the minimum case which includes 2 data bytes. I dropped it in favour for COBS and to keep the TRICE syntax clean. Thinking about your use case, brings me to the conclusion to reactivate it but not spoiling the TRICE syntax. Just a SMALL encoding allowing only 2 value bytes.

rokath commented 2 years ago

Dealing with with several til.json versions, believe me, brings a lot of discomfort especially if colleges simply want watch the logs. It is much easier to tell them just to use the latest til.json version without knowledge about the firmware variant and version. In this context they are not interested in location information. The SW developer generates an li.json and when the trice tool it finds, the location information is displayable.