Bird
0
0

Which of the following is required before calling vTaskGetRunTimeStats() to get accurate CPU usage?

easy📝 Conceptual Q2 of 15
FreeRTOS - Debugging and Monitoring
Which of the following is required before calling vTaskGetRunTimeStats() to get accurate CPU usage?
ADisable interrupts globally
BEnable configGENERATE_RUN_TIME_STATS and provide a timer
CIncrease task priorities manually
DCall vTaskStartScheduler() twice
Step-by-Step Solution
Solution:
  1. Step 1: Check FreeRTOS configuration requirements

    To use vTaskGetRunTimeStats(), configGENERATE_RUN_TIME_STATS must be enabled and a timer must be set up to measure run time.
  2. Step 2: Evaluate other options

    Calling scheduler twice, changing priorities, or disabling interrupts are unrelated to enabling run time stats.
  3. Final Answer:

    Enable configGENERATE_RUN_TIME_STATS and provide a timer -> Option B
  4. Quick Check:

    Enable configGENERATE_RUN_TIME_STATS = required [OK]
Quick Trick: Enable run time stats config before calling vTaskGetRunTimeStats() [OK]
Common Mistakes:
  • Forgetting to enable configGENERATE_RUN_TIME_STATS
  • Assuming scheduler must be restarted
  • Disabling interrupts unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes