stabilizer icon indicating copy to clipboard operation
stabilizer copied to clipboard

Measure run-time task load

Open ryan-summers opened this issue 5 years ago • 4 comments

As part of the stabilizer firmware, it has been brought up that it would be useful to be able to measure and report "task-load" for the various interrupt tasks in RTIC.

This would then be used similar to a top process indicating how much time each processing task is using. This could then be reported as diagnostic telemetry.

There may be built-in functionality in RTIC or by using the ITM to accomplish this.

ryan-summers avatar Nov 12 '20 09:11 ryan-summers

Something simpler and easier than but not unlike the FreeRTOS uxTaskGetSustemState()/vTaskGetInfo().

jordens avatar Nov 12 '20 09:11 jordens

I asked about this on the RTIC Matrix room and it was indicated that RTIC does not have this information inherently, but it would be something that they may be interested in adding to the framework.

It was suggested that embedded-time could be used and provided to RTIC to automatically calculate task durations. It's likely that this would require an RFC to RTIC if we want to get it integrated into the framework

ryan-summers avatar Nov 12 '20 09:11 ryan-summers

Could maybe be a trampoline that wraps the ISRs and records their cycle usage. Or alternatively some explicit hooks that the tasks need to call explicitly on entry and exit to be recorded.

jordens avatar Nov 12 '20 10:11 jordens

https://github.com/rtic-scope

jordens avatar Jun 21 '21 09:06 jordens

sufficiently good solutions exist with itm trace we pushed to probe-rs. closing for now. Might even get better once/if we build a stack sampler and flamegraphs.

jordens avatar Dec 01 '23 14:12 jordens