Add additional tracing functionality to kernel


I am curious if this discussion took place before, otherwise I want to start the discussion to add certain functionality to the FreeRTOS kernel to improve integration with trace tooling like Segger SystemView. (I would like to contribute if appreciated).

I am currently integrating Segger SystemView in a FreeRTOS project of mine and to get the most out of the tooling (detailed analysis, like Scheduler activity and systick interrupt) it is necessary to modify the FreeRTOS source and the used port slightly.

Segger provides a patchset for these modifications, however this is not up to date and the last patchset is meant for FreeRTOS kernal 10.4.3. Of course we could say that Segger should update their patchset more regularly. Or we could say these modifications are essential to build proper trace tooling. FreeRTOS kernal provides tracing hooks ( FreeRTOS trace macros ), but the current tracing hooks are not sufficient to give a clear overview.

In the attachment two printscreens of the differences in the output in the Segger SystemView tooling to give some context.

Patchset of SystemView: SystemView/FreeRTOS_10_4_3.patch at master · SEGGERMicro/SystemView · GitHub

Can we integrate the concept of this patchset in FreeRTOS? Maybe this is also something that tracealyzer wants to use in their trace tooling.

On first look I don’t see anything there that couldn’t be in the mainline code - with the following notes:

  1. I’m not sure the “moved task to nnn list” macros are necessary as the information can be inferred from the function that contains the trace macro.

  2. At least one, if not more, “exit to scheduler” trace macros are placed where the PendSV interrupt gets pended, which is not where the code exits to the scheduler. I’m not sure how SystemView uses that data, but the macro name should probably get changed to be more descriptive of what it is actually doing.

Are you able to cerate a pull request with these updates? We can then figure out the details in the PR.

Great! I will create a PR and we discuss the details there.