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?
2 Answers
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.
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.