Skip to main content

New answers tagged

1 vote
Accepted

Continuously monitor a process and all its children with `top`?

Since I've also wanted a similar capability, I wrote a script that does that. The advantage of the script is that top is running continuously, so it actually shows the CPU consumption of the last ...
aviro's user avatar
  • 5,922
2 votes

Continuously monitor a process and all its children with `top`?

What I came up with for my own question, not as nice as the others people have posted: #!/bin/bash # Tested with `top` from `procps-ng 4.0.3` and `pstree 23.6`. # Print the ID of the given process ...
wobtax's user avatar
  • 318
2 votes

Continuously monitor a process and all its children with `top`?

If you don't mind running your program in a different user namespace using unshare, then you can filter in top according to the user namespace. $ unshare -r $ readlink /proc/$$/ns/user user:[...
aviro's user avatar
  • 5,922
3 votes

Continuously monitor a process and all its children with `top`?

Since you mention in a comment that preparing something before you launch the mother process would generally be feasible, and because your example launches a container, which probably already does ...
Marcus Müller's user avatar
2 votes

Continuously monitor a process and all its children with `top`?

There are a number of options. For any visible field, you can filter on that field. An obvious candidate is TTY=pts/*number*. Note that you will need to turn on display of TTY. One initiates this ...
David G.'s user avatar
  • 1,661

Top 50 recent answers are included