This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Measuring CPU utlization

Hello,

I wish to measure the CPU utlization for a cortex processor running an RTOS (keil RTX). Without an RTOS, i can measure the idle time to come to some conclusion. But with RTOS, can someone guide me how to measure CPU utlization?

Thanks & Best Regards
Vivek

Parents
  • A cheap trick. Let the idle task busy-loop constantly toggling a pin. Check what frequency it manages to toggle the pin. Use a counter to check the number of toggles you get during normal operation. If you get 10% toggles then you spend about 10% of the time in the idle task. With an intelligent scope/logic analyzer, you could also pick up the longest interval without any toggling - that could potentially indicate starvation of your lowest-priority non-idle task.

Reply
  • A cheap trick. Let the idle task busy-loop constantly toggling a pin. Check what frequency it manages to toggle the pin. Use a counter to check the number of toggles you get during normal operation. If you get 10% toggles then you spend about 10% of the time in the idle task. With an intelligent scope/logic analyzer, you could also pick up the longest interval without any toggling - that could potentially indicate starvation of your lowest-priority non-idle task.

Children