- Edited
So in my instrument I want to be able to have some form of CPU measurement to print on a display.
Can one acquire the CPU percentage that the IDE displays in C++? Here I read that "Monitoring CPU and mode switches from the IDE carries quite some CPU overhead.", which means monitoring CPU is wasting CPU right?
In the IDE I get about ~14% but in /proc/xenomai/sched/stat
I get the following:
CPU PID MSW CSW XSC PF STAT %CPU NAME
0 0 0 3660892 0 0 00018000 90.6 [ROOT]
0 7605 9 11 28 0 000600c0 0.0 poly-workstatio
0 7617 2 3 4 0 000480c0 0.0 0x42f80
0 7619 2 3 4 0 000480c0 0.0 0x4313c
0 7620 1 17932 19054 0 00048046 8.6 bela-audio
0 0 0 2545781 0 0 00000000 0.3 [IRQ16: [timer]]
0 0 0 8976 0 0 00000000 0.3 [IRQ21: rtdm_pruss_irq_irq]
Am I missing something? How does 8.6% become 14%? Is the IDE CPU percentage a sum of /proc/xenomai/sched/stat
and ps -p 'myAppPID' -o %cpu --no-headers
?