RTX Thread execution time and Event Recorder

Hello Everyone,

 

I'm using the Event Recorder for the first time to analyze the performance of the RTX threads, my purpose is to get an evaluation of the percentage of each thread's execution time.

In my projects where I use FreeRTOS, I have been using the vTaskGetRunTimeStats function to get the thread execution time information.

 

I've enabled the Event Recorder support in the RTX config file, but probably I misinterpreted the stats generated by the Event Recorder:

 

System Analyzer tells me (more than once) that my MLXTask is running for a very long time (36ms)

I have checked if there is a configuration error or a design error, but I have not found anything that explains the results I saw in the Event Recorder stats: the Event Recorder timestamp is configured correctly and I have checked the execution time for each thread with GPIO debug pins.

The MLXTask, in fact, runs no later than 300us every 3ms (I use the osDelayUntil function).

The MLXTask is only an example, the Event Recorder stats report me strange result when compared with the real performance.

Do you have any idea why I see this mismatch from Event Recorder stats and real performance?

 

Thanks for your help,

Flavio

Parents
  • Thanks   for you suggestion,

    I tried to run the event record section again as reported in my previous post, and you're right, I have a huge number of missed events.

    In accordance with the help page link to me, I have:

    • Disable the Periodic Update in my debug session
    • Increase the Clock Frequency in my Debug Probe (I've set 5Mhz)
    • Increase the number of records (from 64 to 128)

    Since I am only interested in the computation time of each task, so I've enabled only the events regarding the Thread Component, in order to catch every Thread Switch event.

    The results are now a lot more reasonable:

    Now the time report is more reasonable, although it seems way too optimistic to me.

    By enabling only the thread components, could I "miss" a few events that impact on an estimated thread time ?

    Thanks again,


    Flavio

Reply
  • Thanks   for you suggestion,

    I tried to run the event record section again as reported in my previous post, and you're right, I have a huge number of missed events.

    In accordance with the help page link to me, I have:

    • Disable the Periodic Update in my debug session
    • Increase the Clock Frequency in my Debug Probe (I've set 5Mhz)
    • Increase the number of records (from 64 to 128)

    Since I am only interested in the computation time of each task, so I've enabled only the events regarding the Thread Component, in order to catch every Thread Switch event.

    The results are now a lot more reasonable:

    Now the time report is more reasonable, although it seems way too optimistic to me.

    By enabling only the thread components, could I "miss" a few events that impact on an estimated thread time ?

    Thanks again,


    Flavio

Children