FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2012 Threads] 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|