Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to find the CPU usage of a process on ubuntu combined with the cpu usage of all the child process. And also would it be possible to get this number as a % of the total CPU usage?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

not knowing a tool doing exactly what you want but you can find out all the child processes of the process and add them together yourself.

pstree is handy to find all the child processes (more visual than just ps), then for each pid

 ps -p $pid -o "pcpu,cpu"

it should be a fairly simple shellscript given a parent pid. probably there already is one.

share|improve this answer

You can use htop.

sudo apt-get install htop

You can hit F5 on htop to show in tree view which will organize things by parenthood.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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