Using vTaskGetRunTimeStats( char *pcWriteBuffer );

ose wrote on Saturday, April 28, 2018:

Hallo,
I am trying to use the vTaskGetRunTimeStats to display the task execution time in a tabular form.
First of all, should i call the function in the main function, like after the vTaskStartScheduler?

Secondly, what then do I have to do to see the tabular format ? Because from https://www.freertos.org/rtos-run-time-stats.html , it looks like on the example picture one has to put in an ip addresss or so.

rtel wrote on Sunday, April 29, 2018:

I replied to this via email but the post didn’t show - apologies if it now shows up twice:

First of all, should i call the function in the main function, like after the vTaskStartScheduler?

No - nothing that appears vTaskStartScheduler() will ever be reached s(assuming vTaskStartScheduler() actually starts the scheduler - which will be the case unless you run out of heap when creating the idle and/or timer tasks) so it won’t execute if you put it there.

It should be called from whichever task you want to print the stats.

Secondly, what then do I have to do to see the tabular format ? Because from FreeRTOS Run Time Stats , it looks like on the example picture one has to put in an ip addresss or so.

The page you link to shows how to use run-time stats in general, including how to set up the clocks. The API page for vTaskGetRunTimeStats() is here RTOS task (thread) utilities including API functions for tracing FreeRTOS, getting the RTOS tick count, getting a task handle, getting the RTOS kernel or RTOS scheduler state, listing the tasks in the embedded system, and obtaining run time task statistics. and shows you pass in the address of the buffer into which you would like the stats to be written. That pages also shows the prerequisites of having configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS defined.

rtel wrote on Sunday, April 29, 2018:

First of all, should i call the function in the main function, like
after the vTaskStartScheduler?

No - nothing that appears vTaskStartScheduler() will ever be reached
s(assuming vTaskStartScheduler() actually starts the scheduler - which
will be the case unless you run out of heap when creating the idle
and/or timer tasks) so it won’t execute if you put it there.

It should be called from whichever task you want to print the stats.

Secondly, what then do I have to do to see the tabular format ? Because
from FreeRTOS Run Time Stats , it looks like
on the example picture one has to put in an ip addresss or so.

The page you link to shows how to use run-time stats in general,
including how to set up the clocks. The API page for
vTaskGetRunTimeStats() is here
RTOS task (thread) utilities including API functions for tracing FreeRTOS, getting the RTOS tick count, getting a task handle, getting the RTOS kernel or RTOS scheduler state, listing the tasks in the embedded system, and obtaining run time task statistics. and shows you
pass in the address of the buffer into which you would like the stats to
be written. That pages also shows the prerequisites of having
configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS
defined.

tlafleur wrote on Sunday, April 29, 2018:

Richard…

as it relates to this, have the stats show what CPU core is attach to what
task would be good addition in multi core CPU…

thanks

~~ _/) _/) _/) ``` _/) ~~

Tom Lafleur

On Sun, Apr 29, 2018 at 11:29 AM, Richard Barry rtel@users.sourceforge.net
wrote:

I replied to this via email but the post didn’t show - apologies if it now
shows up twice:

First of all, should i call the function in the main function, like after
the vTaskStartScheduler?

No - nothing that appears vTaskStartScheduler() will ever be reached
s(assuming vTaskStartScheduler() actually starts the scheduler - which will
be the case unless you run out of heap when creating the idle and/or timer
tasks) so it won’t execute if you put it there.

It should be called from whichever task you want to print the stats.

Secondly, what then do I have to do to see the tabular format ? Because
from FreeRTOS Run Time Stats , it looks like on
the example picture one has to put in an ip addresss or so.

The page you link to shows how to use run-time stats in general, including
how to set up the clocks. The API page for vTaskGetRunTimeStats() is here
RTOS task (thread) utilities including API functions for tracing FreeRTOS, getting the RTOS tick count, getting a task handle, getting the RTOS kernel or RTOS scheduler state, listing the tasks in the embedded system, and obtaining run time task statistics. and shows you
pass in the address of the buffer into which you would like the stats to be
written. That pages also shows the prerequisites of having
configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS
defined.

Using vTaskGetRunTimeStats( char *pcWriteBuffer );
https://sourceforge.net/p/freertos/discussion/382005/thread/8d6d3a1b/?limit=25#4716

Sent from sourceforge.net because you indicated interest in
SourceForge.net: Log In to SourceForge.net

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net