2

I have a version of FreeRTOS which comes with a TraceAlyzer tool and I need to compare how it affects the effectivity of the whole systems (for what time it slows it down). I have 2 simple tasks which run and delay for a short time. I run system twice with Tracealyzer started and without for some number of iterations.

I am aware of vTaskGetRunTimeStats(), but as far as I understand it only measures the run time of one task, not of the entire system. At the moment I am using the PowerShell tool Measure-Command, but I would like to use a built-in tool in FreeRTOS.

How do I measure the execution time for the entire system (all tasks, not just one) in FreeRTOS?

DK2AX
  • 265
  • 5
  • 16
  • https://www.freertos.org/Documentation/FreeRTOS_Reference_Manual_V10.0.0.pdf ? I just google it... you should learn to search yourself – Stargateur Apr 14 '18 at 18:40
  • @Stargateur Well, that's a useless comment. I wouldn't ask a question here if the solution could be found in the manual. – DK2AX Apr 14 '18 at 18:43
  • 2
    You'd be surprised. And when asking for a "best" solution you should specify the metric by which you want to measure that. – Ingo Bürk Apr 14 '18 at 18:46
  • In the manual, I found **2.3** `vTaskGetRunTimeStats()` about which it says "FreeRTOS can be configured to collect task run time statistics." Is this appropriate for you? – Weather Vane Apr 14 '18 at 18:47
  • @WeatherVane That is also what I found, but I managed to get it running only for one task. My problem is that I would like to get the total system runtime, i.e. for all tasks. At the moment I am measuring the time for the whole system externally through 'Measure-Command', but this seems quite inaccurate. I'll update the question to clarify that. – DK2AX Apr 14 '18 at 18:51
  • Sorry, I fail my link, I forget it was a pdf, search the fonction `xTimerCreate()`, page 259 – Stargateur Apr 14 '18 at 18:52
  • I further quote from the manual 2.3 `vTaskGetRunTimeStats()` "Task run time statistics provide information on the amount of processing time **each task** has received." (my emphasis). – Weather Vane Apr 14 '18 at 18:54
  • Ah, I see. But it seems this doesn't count delays, interrupts, etc., but only the pure run time. Is there a way to also include all this overhead in the measurement? – DK2AX Apr 14 '18 at 19:21

1 Answers1

1

vTaskGetRunTimeStats() will provide stats for all tasks, provided you have configured the clock it uses. This image is an example of the data it provides: https://freertos.org/rtos-run-time-stats.jpg

If you just want the raw data then use https://freertos.org/uxTaskGetSystemState.html

Richard
  • 3,081
  • 11
  • 9