Quality RTOS & Embedded Software

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




Loading

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

Thanks,
Wes

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.

Regards.

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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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