History

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]#

Arnaldo Carvalho de Melo committed 16 years ago

Commit 2e7d1e31 parent 6545aaa1 file · +2 −5Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/sctop.py+2−5
@@ -8,10 +8,7 @@ · 7 unmodified lines
88 # will be refreshed every [interval] seconds. The default interval is
99 # 3 seconds.
1010
11−import thread
12−import time
13−import os
14−import sys
11+import os, sys, thread, time
1512
1613 sys.path.append(os.environ['PERF_EXEC_PATH'] + \
1714 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
@@ -71,7 +68,7 @@ def print_syscall_totals(interval): · 53 unmodified lines
7168 for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \
7269 reverse = True):
7370 try:
74− print "%-40d %10d\n" % (id, val),
71+ print "%-40s %10d\n" % (syscall_name(id), val),
7572 except TypeError:
7673 pass
7774 syscalls.clear()