Linux:pidstat命令
root@riguz_hk:~# pidstat Linux 4.4.0-85-generic (riguz_hk) 02/26/2018 _i686_ (1 CPU) 04:18:03 PM UID PID %usr %system %guest %CPU CPU Command 04:18:03 PM 0 1 0.00 0.00 0.00 0.00 0 systemd 04:18:03 PM 0 2 0.00 0.00 0.00 0.00 0 kthreadd 04:18:03 PM 0 3 0.00 0.00 0.00 0.00 0 ksoftirqd/0 04:18:03 PM 0 7 0.00 0.00 0.00 0.00 0 rcu_sched 04:18:03 PM 0 10 0.00 0.00 0.00 0.00 0 watchdog/0 04:18:03 PM 0 14 0.00 0.00 0.00 0.00 0 khungtaskd
监控进程:
root@riguz_hk:~# pidstat -p 3791 -u 1 3 Linux 4.4.0-85-generic (riguz_hk) 02/26/2018 _i686_ (1 CPU) 04:21:12 PM UID PID %usr %system %guest %CPU CPU Command 04:21:13 PM 33 3791 0.00 0.00 0.00 0.00 0 apache2 04:21:14 PM 33 3791 0.00 0.00 0.00 0.00 0 apache2 04:21:15 PM 33 3791 0.00 0.00 0.00 0.00 0 apache2 Average: 33 3791 0.00 0.00 0.00 0.00 - apache2
监控线程:
root@riguz_hk:~# pidstat -p 3791 -u 1 3 -t Linux 4.4.0-85-generic (riguz_hk) 02/26/2018 _i686_ (1 CPU) 04:21:42 PM UID TGID TID %usr %system %guest %CPU CPU Command 04:21:43 PM 33 3791 - 0.00 0.00 0.00 0.00 0 apache2 04:21:43 PM 33 - 3791 0.00 0.00 0.00 0.00 0 |__apache2 04:21:43 PM UID TGID TID %usr %system %guest %CPU CPU Command 04:21:44 PM 33 3791 - 0.00 0.00 0.00 0.00 0 apache2 04:21:44 PM 33 - 3791 0.00 0.00 0.00 0.00 0 |__apache2 04:21:44 PM UID TGID TID %usr %system %guest %CPU CPU Command 04:21:45 PM 33 3791 - 0.00 0.00 0.00 0.00 0 apache2 04:21:45 PM 33 - 3791 0.00 0.00 0.00 0.00 0 |__apache2 Average: UID TGID TID %usr %system %guest %CPU CPU Command Average: 33 3791 - 0.00 0.00 0.00 0.00 - apache2 Average: 33 - 3791 0.00 0.00 0.00 0.00 - |__apache2