waterloo-rocketry / cansw_processor_airbrakes

Processor board was developed for the 2023-2024 design cycle to perform state estimation and control tasks for Borealis's airbrakes system
2 stars 0 forks source link

Concurrent logging #65

Closed celery6 closed 2 months ago

celery6 commented 2 months ago

maybe this speeds up logging idk

the concept is to split each log buffer into n sections, where each section will be handed off to tasks to write in. When a task uses logInfo, logger calculates the next free section and gives it to the task. No other task can have this section. Now multiple tasks can write to their own sections concurrently.

The downside is that most msgs do not fill the entire section, so there's a LOT of empty space. We should optimize the size of sections to be as small as possible. Possibly break up the VN log msgs into multiple msgs because that's constraining the section length requirement rn.

Other downside: buffers fill up a lot faster so it dumps to SD card more frequently. Probably not issue cuz SD card write speed is not a bottleneck.


things to test:

Joe-Joe-Joe-Joe commented 2 months ago

closes #40

Taggagii commented 2 months ago

The diffs are 0. If I increase the tick rate to 10000 the diff values are like 3-6. And also the logging is passing. However the log file is not being padded (see attached picture). Otherwise it appears to be working image

Joe-Joe-Joe-Joe commented 2 months ago

not sure what Josh means by tick rate. but this is what I got. A bunch of trailing null characters for a bunch of messages until precisely 3 seconds in when the logs shit themselves and then start padding properly image image

but this is what I really care about image Pretty sure you can't "safely" increase the tick rate (assuming you mean of freeRTOS) above 1000, at least according to the ioc file tooltip. But I can log arbitrarily sized buffers at this speed so I am happy