Quality RTOS & Embedded Software

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


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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists