Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Suggestion for Task Profiling - Exec Cnt

Posted by https://me.yahoo.com/a/Totshr9t on 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.

RE: Suggestion for Task Profiling - Exec Cnt

Posted by Richard Damon on 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.

RE: Suggestion for Task Profiling - Exec Cnt

Posted by Dave on 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.

RE: Suggestion for Task Profiling - Exec Cnt

Posted by https://me.yahoo.com/a/Totshr9t on 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner