Suggestion for Task Profiling - Exec Cnt

anonymous wrote on Thursday, January 26, 2012:

re: LPC1765

I got the Task Runtime Stats and Task List profiling setup and working very easy.  That is great.  Dumping everything out my UART0.  However, the only parameter I miss is seeing a count on the number of times a task has been called - the execution count.  Exec Time and Duty Cycle helps, but there are occasions where seeing the exact number of times a task has been run is of vital interest.

Just a suggestion.

Thanks, Chris.

richard_damon wrote on Thursday, January 26, 2012:

Note that unless you are deleting the task and then recreating it, a given task is only run once. (and if you delete and recreate a task it really is a new task). Tasks normally have a loop inside of them, but that is outside of the view of FreeRTOS. If you want to keep trace of the number of time the task has looped, just add a counter in your code.

davedoors wrote on Thursday, January 26, 2012:

I read the OP to mean a count of the number of times the task is scheduled to run, so if it moves from Block to Running state the counter would increment. Is that right? If so, it sounds like a good idea although it would add a bit to the context switch code, you should add it to the features request tracker in sourceforge.

It could be done using trace macros too.

anonymous wrote on Friday, January 27, 2012:

I wrote my own Performance Monitor module for FreeRTOS a few years ago, because it did not have one at the time.  There is an easy way to keep track of how many times a task runs.  It is really the same kind of thing as keeping track of how much time is spent in a task.  If you can do that, you already have all the info necessary to know how many times it has run.  It is automatic.  Most other RTOS performance monitors all have this feature.