Is it possible to display CPU core usage just for a single process and its child processes on Linux?


Do you mean all processes started by some process (have the same parent PID)?

If you have pgrep you can filter all the processes with the same parent ID:

top -p $(pgrep -P 2069 -d,)

If not you can filter all process ids through awk and use them with top -p:

top -p $(ps -eo pid,ppid |awk '($2==2069){printf "%s%s",delim,$1; delim=","}')

Change $2==2069 with the actual parent pid you want to track.

  • That would show information about a single core usage, wouldn't it? – syntagma Jun 15 '15 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.