My code often use a lot of “system cpu” (on ubuntu).
I understand that this means that the cpu is doing something else than actually running my code. I heard it can for instance input/ouput management.
I have two questions:
1) Can I have a more exhaustive list of what the cpu could be doing when it’s on “system cpu”?
2) When I run a specific program, is there a way to identify, what the system cpu is doing on this run? (some kind of “system cpu” profiling)
When your CPU is in system state, that’s because system calls are being executed. These system calls are for example I/Os (display, network, files), or memory (allocation, …).
You can run your program using strace to get a verbose display of what system calls are currently executed by your program.