Quality RTOS & Embedded Software

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


Additional Runtime Stats Interest?

Posted by Weston T. Schmidt on November 2, 2012
I have code that provides cpu usage per task. It's a pretty small amount of code, but before I untangle it from a few other customizations I wanted to see if there is interest.

To help me, I have changed the sprintf() format of the output & merge it in each re-base I do. While not a lot of work, it's not the most fun thing to do & I've noticed that others have looked at alternatives to sprintf() before. Would there be interest in passing back an array of a specific data structure to an externally provided output routine instead of building the formatting into FreeRTOS? (I'd imagine that the current default output could easily be provided if the external output function isn't provided.)


RE: Additional Runtime Stats Interest?

Posted by Richard on November 2, 2012
It would definitely be beneficial to remove any sprintf()'ing from the core code, for portability reasons if nothing else. Having the data placed into an array of structures would have been a better design choice as it would also allow the code to be processed from C code, rather than just displayed. (the functions that perform this were only really intended as debugging aids but have seen use outside of that)

My concern with changing this code is that it would break applications that use the existing method - including many of the official FreeRTOS demos. I would propose that, rather than change the behaviour of the existing function, a new function is added that obtains the same information but presents it in a different way (in an array of structures).

To do that the application writer would have to provide the array of structures to be filled, as the kernel could not statically declare such a structure as it would not know how big it had to be at compile time (and it would waste RAM for users that don't use that functionality).

Can you please add a feature request into the tracker in SourceForge for this please. I think it would be a very beneficial enhancement.


RE: Additional Runtime Stats Interest?

Posted by Weston T. Schmidt on November 2, 2012
Yes - I'll attach the patches of what I have in mind as well. I should have this done by Monday.

[ 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.

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