Menu

#67 vTaskGetRunTimeStats generate value > 100%

closed-fixed
nobody
None
5
2019-01-08
2013-06-07
No

I'm using the vTaskGetRunTimeStats to get runtime information of the tasks.
But 1 task starts out with CPU usage to more than 100 % (A huge number ex: 152354223%)
The value is decreasing over time and ends up where it should be.

The task is straight forward, it waits on a queue with a timeout of 5 sec. The priority is just like the other task

Discussion

  • Richard

    Richard - 2013-06-25
    • status: open --> closed-fixed
     
  • pugglewuggle

    pugglewuggle - 2014-02-25

    Did you guys ever find the answer to this? There doesn't seem to be any closing notes. I'm experiencing the same thing on 7.6.0.

    It's showing 189% for me. The task does nothing but toggle a GPIO pin and vTask delay for 1 millisecond. Was using this for testing timing but I left it running and just happened to notice this.

    void freq1kHzPremptTest(void* pvParameters){
        for(;;){
            gpio_toggle_pin(PIO_PA20_IDX);
            vTaskDelay(1/portTICK_RATE_MS);
        }
    }
    
     

    Last edit: pugglewuggle 2014-02-25
  • pugglewuggle

    pugglewuggle - 2014-02-25

    I'll also add that I just noticed even after power-off reset it is immediately over 100%. Haven't seen this before.

     
  • pugglewuggle

    pugglewuggle - 2014-02-25

    Dropping vTaskDelay to 2ms instead of 1ms makes everything report properly. Running @ 12MHz on CortexM4 so I don't know why that would make that big of a difference.

     
  • Antoine

    Antoine - 2019-01-08

    I had the same problem on FreeRTOS and I found a solution.
    For portCONFIGURE_TIMER_FOR_RUN_TIME_STATS () and portGET_RUN_TIME_COUNTER_VALUE () I had configured timer 16bits with 20kHz frequency
    Now I have changed with 32bits timer and the problem is corrected.

     

Log in to post a comment.

MongoDB Logo MongoDB