git clone --depth 1 https://github.com/brendangregg/perf-tools
使用cachestat
[root@i-ifgwrq7g ~]# ./perf-tools/bin/cachestat
Counting cache functions... Output every 1 seconds.
HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB
232 225 2 50.8% 0 174
428 5 0 98.8% 0 175
433 0 0 100.0% 0 175
2496 872 2 74.1% 0 175
323 5 0 98.5% 0 176
327 2 5 99.4% 0 176
303 148 2 67.2% 0 174
323 5 0 98.5% 0 175
328 0 0 100.0% 0 175
339 194 3 63.6% 0 174
428 5 0 98.8% 0 175
426 0 13 100.0% 0 175
304 148 2 67.3% 0 174
2833 512 0 84.7% 0 177
328 0 0 100.0% 0 177
305 148 2 67.3% 0 174
^C 416 5 0 98.8% 0 175
使用execsnoop
[root@i-ifgwrq7g ~]# ./perf-tools/bin/execsnoop
Tracing exec()s. Ctrl-C to end.
Instrumenting sys_execve
PID PPID ARGS
578 576 cat -v trace_pipe
577 573 gawk -v o=1 -v opt_name=0 -v name= -v opt_duration=0 [...]
帮助文档目录 /perf-tools/man/man8
[root@i-ifgwrq7g man8]# ll
total 96
-rw-r--r-- 1 root root 2457 Feb 1 16:44 bitesize.8
-rw-r--r-- 1 root root 3839 Feb 1 16:44 cachestat.8
-rw-r--r-- 1 root root 3497 Feb 1 16:44 execsnoop.8
-rw-r--r-- 1 root root 2094 Feb 1 16:44 funccount.8
-rw-r--r-- 1 root root 6010 Feb 1 16:44 funcgraph.8
-rw-r--r-- 1 root root 4190 Feb 1 16:44 funcslower.8
-rw-r--r-- 1 root root 3922 Feb 1 16:44 functrace.8
-rw-r--r-- 1 root root 3656 Feb 1 16:44 iolatency.8
-rw-r--r-- 1 root root 5856 Feb 1 16:44 iosnoop.8
-rw-r--r-- 1 root root 2944 Feb 1 16:44 killsnoop.8
-rw-r--r-- 1 root root 5394 Feb 1 16:44 kprobe.8
-rw-r--r-- 1 root root 3194 Feb 1 16:44 opensnoop.8
-rw-r--r-- 1 root root 3920 Feb 1 16:44 perf-stat-hist.8
-rw-r--r-- 1 root root 1292 Feb 1 16:44 reset-ftrace.8
-rw-r--r-- 1 root root 2599 Feb 1 16:44 syscount.8
-rw-r--r-- 1 root root 2773 Feb 1 16:44 tcpretrans.8
-rw-r--r-- 1 root root 4136 Feb 1 16:44 tpoint.8
-rw-r--r-- 1 root root 6048 Feb 1 16:44 uprobe.8
[root@i-ifgwrq7g man8]# pwd
/root/perf-tools/man/man8
网友评论