提交 2e7d1e3f 编写于 作者: A Arnaldo Carvalho de Melo

perf python scripting: print the syscall name on sctop

[root@emilia tmp]# perf trace sctop 1
syscall events:

event                                          count
----------------------------------------  ----------
read                                          215400
futex                                           4029
write                                            376
brk                                               33
rt_sigprocmask                                    24
select                                            17
lseek                                              2
fsync                                              1
^C[root@emilia tmp]#

Cc: David S. Miller <davem@davemloft.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 6545aaa5
...@@ -8,10 +8,7 @@ ...@@ -8,10 +8,7 @@
# will be refreshed every [interval] seconds. The default interval is # will be refreshed every [interval] seconds. The default interval is
# 3 seconds. # 3 seconds.
import thread import os, sys, thread, time
import time
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace') '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
...@@ -71,7 +68,7 @@ def print_syscall_totals(interval): ...@@ -71,7 +68,7 @@ def print_syscall_totals(interval):
for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \ for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \
reverse = True): reverse = True):
try: try:
print "%-40d %10d\n" % (id, val), print "%-40s %10d\n" % (syscall_name(id), val),
except TypeError: except TypeError:
pass pass
syscalls.clear() syscalls.clear()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册