/
usr
/
share
/
systemtap
/
examples
/
process
/
/usr/share/systemtap/examples/process
mkdir
upload
Name
Size
Mode
Actions
auditbt.meta
429
0644
edit
dl
rm
auditbt.stp
622
0755
edit
dl
rm
auditbt.tcl
79
0644
edit
dl
rm
chng_cpu.meta
775
0644
edit
dl
rm
chng_cpu.stp
1049
0755
edit
dl
rm
chng_cpu.tcl
140
0644
edit
dl
rm
cycle_thief.meta
1082
0644
edit
dl
rm
cycle_thief.stp
2893
0755
edit
dl
rm
cycle_thief.txt
5974
0644
edit
dl
rm
errsnoop.meta
575
0644
edit
dl
rm
errsnoop.stp
1015
0755
edit
dl
rm
forktracker.meta
525
0644
edit
dl
rm
forktracker.stp
601
0755
edit
dl
rm
futexes.meta
520
0644
edit
dl
rm
futexes.stp
1118
0755
edit
dl
rm
futexes.txt
944
0644
edit
dl
rm
futexes2.meta
593
0644
edit
dl
rm
futexes2.stp
2014
0644
edit
dl
rm
ltrace.meta
314
0644
edit
dl
rm
ltrace.stp
3007
0755
edit
dl
rm
ltrace.tcl
122
0644
edit
dl
rm
migrate.meta
746
0644
edit
dl
rm
migrate.stp
1037
0755
edit
dl
rm
mutex-contention.meta
479
0644
edit
dl
rm
mutex-contention.stp
5559
0755
edit
dl
rm
mutex-contention.tcl
79
0644
edit
dl
rm
noptrace.meta
512
0644
edit
dl
rm
noptrace.stp
2235
0755
edit
dl
rm
noptrace.txt
1212
0644
edit
dl
rm
pfiles.meta
450
0644
edit
dl
rm
pfiles.stp
24523
0755
edit
dl
rm
plimit.meta
387
0644
edit
dl
rm
plimit.stp
3029
0755
edit
dl
rm
procmod_watcher.meta
657
0644
edit
dl
rm
procmod_watcher.stp
2406
0644
edit
dl
rm
proctop.meta
601
0644
edit
dl
rm
proctop.stp
4245
0755
edit
dl
rm
proctop.txt
8654
0644
edit
dl
rm
proc_snoop.stp
1133
0755
edit
dl
rm
proc_snoop_parser.xml
818
0644
edit
dl
rm
proc_snoop_parser_instructions.txt
2180
0644
edit
dl
rm
psig.meta
354
0644
edit
dl
rm
psig.stp
5616
0755
edit
dl
rm
pstrace_exec.meta
545
0644
edit
dl
rm
pstrace_exec.stp
465
0755
edit
dl
rm
pstree.meta
455
0644
edit
dl
rm
pstree.stp
1957
0755
edit
dl
rm
rlimit_nofile.meta
319
0644
edit
dl
rm
rlimit_nofile.stp
1151
0755
edit
dl
rm
sched-latency.meta
470
0644
edit
dl
rm
sched-latency.stp
508
0644
edit
dl
rm
sched-latency.txt
1566
0644
edit
dl
rm
schedtimes.meta
814
0644
edit
dl
rm
schedtimes.stp
3949
0755
edit
dl
rm
schedtimes.txt
3278
0644
edit
dl
rm
semop-watch.meta
267
0644
edit
dl
rm
semop-watch.stp
822
0755
edit
dl
rm
sigkill.meta
560
0644
edit
dl
rm
sigkill.stp
656
0755
edit
dl
rm
sigmon.meta
669
0644
edit
dl
rm
sigmon.stp
932
0755
edit
dl
rm
sig_by_pid.meta
357
0644
edit
dl
rm
sig_by_pid.stp
1078
0755
edit
dl
rm
sig_by_pid.txt
1514
0644
edit
dl
rm
sig_by_proc.meta
364
0644
edit
dl
rm
sig_by_proc.stp
851
0755
edit
dl
rm
sig_by_proc.txt
951
0644
edit
dl
rm
sleepingBeauties.meta
581
0644
edit
dl
rm
sleepingBeauties.stp
1364
0755
edit
dl
rm
sleepingBeauties.tcl
140
0644
edit
dl
rm
sleeptime.meta
601
0644
edit
dl
rm
sleeptime.stp
1469
0755
edit
dl
rm
spawn_seeker.meta
854
0644
edit
dl
rm
spawn_seeker.stp
1526
0755
edit
dl
rm
spawn_seeker.txt
1318
0644
edit
dl
rm
strace.meta
385
0644
edit
dl
rm
strace.stp
2081
0755
edit
dl
rm
strace.txt
3672
0644
edit
dl
rm
syscalls_by_pid.meta
514
0644
edit
dl
rm
syscalls_by_pid.stp
633
0755
edit
dl
rm
syscalls_by_pid.txt
597
0644
edit
dl
rm
syscalls_by_proc.meta
531
0644
edit
dl
rm
syscalls_by_proc.stp
692
0755
edit
dl
rm
syscalls_by_proc.txt
1130
0644
edit
dl
rm
syscalltimes
6291
0755
edit
dl
rm
syscalltimes.meta
454
0644
edit
dl
rm
syscalltimes.txt
11459
0644
edit
dl
rm
thread-business.meta
346
0644
edit
dl
rm
thread-business.stp
866
0755
edit
dl
rm
thread-business.txt
2823
0644
edit
dl
rm
threadstacks.meta
585
0644
edit
dl
rm
threadstacks.stp
1789
0755
edit
dl
rm
threadstacks.tcl
79
0644
edit
dl
rm
wait4time.meta
658
0644
edit
dl
rm
wait4time.stp
1347
0755
edit
dl
rm
Edit:
/usr/share/systemtap/examples/process/proctop.txt
(8654B)
proctop.stp: Periodically print process info while keeping a history Description: Every 5 seconds, print out a list of 25 processes that took the most system time with information about the processes. Includes information on processes that may have exited while the script was running. The script contains configuration options listed in the script source. $ stap proctop.stp -T 12 5 seconds: showing 25 out of 54 tasks PID Process State VirtMem RSSMem ShrdMem CPU Time User Time 2236 pulseaudio S 643694592 8724480 6864896 7094425000000 2978547000000 1158 Xorg S 223195136 28401664 9035776 5774527000000 4390357000000 12744 qemu-system-x86 S 4969811968 2215833600 7876608 2569998000000 62426178000000 2741 tmux S 143491072 17453056 2449408 1325262000000 2353978000000 9032 firefox S 3280347136 1484169216 77258752 1281250000000 102632316000000 7345 qemu-system-x86 S 4983103488 2269044736 7933952 1225863000000 7366649000000 9145 plugin-containe S 1173696512 121954304 41582592 1129882000000 4464864000000 2633 xchat S 702238720 28114944 15888384 467695000000 2456379000000 24798 xfwm4 S 507027456 13905920 10489856 331524000000 732607000000 2140 xfce4-panel S 598822912 16449536 11145216 187518000000 1842513000000 2131 xfce4-session S 442097664 8134656 6328320 80346000000 133387000000 7 rcu_sched S 0 0 0 52510000000 0 2239 xscreensaver S 199114752 5754880 4874240 48930000000 43000000000 8 rcuos/0 S 0 0 0 42512000000 0 0 swapper/0 R 0 0 0 38474000000 0 846 rngd S 4468736 1282048 1253376 33684000000 69954000000 10 rcuos/2 S 0 0 0 33366000000 0 2389 pool S 654041088 13492224 4538368 29291000000 35436000000 976 NetworkManager S 454553600 6369280 4857856 28305000000 123014000000 7410 vhost-7345 S 4983103488 2269044736 7933952 23621000000 0 869 in:imjournal S 822587392 8859648 8499200 23447000000 13619000000 4284 xfce4-terminal S 778174464 24412160 18997248 23330000000 152980000000 22385 python2 S 2573504512 13864960 7249920 13122000000 61526000000 523 systemd-journal S 111550464 36225024 33824768 12646000000 3644000000 8501 python2 S 2573733888 16203776 7573504 11809000000 55554000000 ----------------------------------------------------------------------------------------------------------------- 10 seconds: showing 25 out of 58 tasks PID Process State VirtMem RSSMem ShrdMem CPU Time User Time 2236 pulseaudio S 643694592 8724480 6864896 7094446000000 2978555000000 1158 Xorg S 223195136 28401664 9035776 5774528000000 4390357000000 12744 qemu-system-x86 S 4969811968 2215833600 7876608 2569998000000 62426178000000 2741 tmux S 143491072 17453056 2449408 1325262000000 2353978000000 9032 firefox S 3280347136 1486053376 77258752 1281262000000 102633852000000 7345 qemu-system-x86 S 4983103488 2269044736 7933952 1225863000000 7366649000000 9145 plugin-containe S 1173696512 121954304 41582592 1129887000000 4464898000000 2633 xchat S 702238720 28114944 15888384 467696000000 2456379000000 1021 wpa_supplicant S 60608512 10592256 4325376 339374000000 32641000000 24798 xfwm4 S 507027456 13905920 10489856 331524000000 732607000000 849 irqbalance S 19599360 2162688 2060288 237728000000 39968000000 2140 xfce4-panel S 598822912 16449536 11145216 187518000000 1842513000000 2131 xfce4-session S 442097664 8134656 6328320 80346000000 133387000000 7 rcu_sched S 0 0 0 52510000000 0 2239 xscreensaver S 199114752 5754880 4874240 48930000000 43000000000 8 rcuos/0 S 0 0 0 42512000000 0 0 swapper/0 R 0 0 0 38474000000 0 846 rngd S 4468736 1282048 1253376 33684000000 69954000000 10 rcuos/2 S 0 0 0 33366000000 0 2389 pool S 654041088 13492224 4538368 29291000000 35436000000 976 NetworkManager S 454553600 6369280 4857856 28305000000 123014000000 7410 vhost-7345 S 4983103488 2269044736 7933952 23621000000 0 869 in:imjournal S 822587392 8859648 8499200 23447000000 13619000000 4284 xfce4-terminal S 778174464 24412160 18997248 23330000000 152980000000 39 khugepaged S 0 0 0 18809000000 0 ----------------------------------------------------------------------------------------------------------------- This is the default configuration of the proctop.stp script. It sorts based on cpu time, and only shows a max of 25 processes. A configuration that might be useful would be to sort by the state to see a short list of the processes that have stopped while the script was running. $ stap proctop.stp -T 12 -G show=5 -G sort=state -G sortby=decrease 5 seconds: showing 5 out of 61 tasks PID Process State VirtMem RSSMem ShrdMem CPU Time User Time 12319 systemd-udevd DEAD 0 0 0 0 0 9032 Timer S 3280166912 1453039616 76521472 1288175000000 104009126000000 12318 stapio S 129527808 860160 782336 18000000 3000000 7 rcu_sched S 0 0 0 52576000000 0 10 rcuos/2 S 0 0 0 33408000000 0 ----------------------------------------------------------------------------------------------------------------- 10 seconds: showing 5 out of 74 tasks PID Process State VirtMem RSSMem ShrdMem CPU Time User Time 12319 systemd-udevd DEAD 0 0 0 0 0 12323 bash DEAD 0 0 0 0 0 12324 git DEAD 0 0 0 1000000 0 12325 bash DEAD 0 0 0 1000000 0 12326 git DEAD 0 0 0 0 0 -----------------------------------------------------------------------------------------------------------------
Save
cmd:
run