Vscode xrtos window runtime not updating

So I have FreeRTOS runnong on a rasberry PI PICO board and I can debug and run my application code using vscode To this point I am very happy.

I want to look at the utilisation figures to see how much I have left in the CPU so I have changed FreeRTOSConfig.h to have the folllowing settings…

/* Run time and task stats gathering related definitions. */
#define configGENERATE_RUN_TIME_STATS           1
#define configUSE_TRACE_FACILITY                1
#define configUSE_STATS_FORMATTING_FUNCTIONS    1

#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  configure_timer_for_run_time_stats
#define portGET_RUN_TIME_COUNTER_VALUE          get_run_time_counter_value
#define configRECORD_STACK_HIGH_ADDRESS         1

In main.c I have the following implementations for the run time stats…

void configure_timer_for_run_time_stats(void){
    // this can remain empty since the SDK already sets up a free timer for us !! 
}

/** \brief This macro should just return the current 'time' 
    \details Current time as defined by timer that has been configured above. 
*/
static configRUN_TIME_COUNTER_TYPE thistime = 0UL;
configRUN_TIME_COUNTER_TYPE get_run_time_counter_value(void){
    thistime = timer_hw->timelr;
    return thistime;
}

I have checked and thistime is incrementing but when I look in the XRTOS window in vscode I have all the figures except the Runtime which is the one I am looking for.

I know my get_run_time_counter_value is being called. I am not sure what to do next.

Any advice would be greatly appreciated.

Assuming that the XRTOS tab comes from the rtos-views plugin, looking at the source code of the plugin, enabling run time stats is all you need to do to populate runtime - rtos-views/src/rtos/rtos-freertos.ts at main · mcu-debug/rtos-views · GitHub.

Can you use vTaskGetRunTimeStatistics or uxTaskGetSystemState API to verify that runtime stats are getting populated correctly?

I cannot find vTaskGetRunTimeStatistics in the code but there is an interface ulTaskGetRunTimePercent that seems to return a value and the implementation of that looks like what I am looking for. It just a shame I cannot get it realtime from the interface… I am looking at uxTaskGetSystemState now but I dont think I want to drop that into an existing task I will create another to monitor the system and call this from there to see what it provides.

On another note the XRTOS display correctly lists my tasks, the stack usage (correct or not) its really just the Runtime that is missing (currently ??? is displayed. )

This is a recent API. If you do not have this, you would have vTaskGetRunTimeStats.

You should open an issue with the plugin maintainers for this.

You are correct; someone else was there first.

issues/43

I think its being progressed.

Thank you for letting us know.