aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/syscall-counts.py
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-04-11 08:36:30 -0400
committerTakashi Iwai <tiwai@suse.de>2019-04-11 08:36:30 -0400
commit9b0dcd0e5a27958b57e3e390f63c098d63a055da (patch)
treede778d683f121d3062df316994e9c4cf195eb12c /tools/perf/scripts/python/syscall-counts.py
parentd7a181da2dfa3190487c446042ba01e07d851c74 (diff)
parentac71317e6be01812cc0c54d8be6d3c1139c8380b (diff)
Merge tag 'asoc-fix-v5.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.1 A few core fixes along with the driver specific ones, mainly fixing small issues that only affect x86 platforms for various reasons (their unusual machine enumeration mechanisms mainly, plus a fix for error handling in topology). There's some of the driver fixes that look larger than they are, like the hdmi-codec changes which resulted in an indentation change, and most of the other large changes are for new drivers like the STM32 changes.
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
-rw-r--r--tools/perf/scripts/python/syscall-counts.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/perf/scripts/python/syscall-counts.py b/tools/perf/scripts/python/syscall-counts.py
index e66a7730aeb5..8adb95ff1664 100644
--- a/tools/perf/scripts/python/syscall-counts.py
+++ b/tools/perf/scripts/python/syscall-counts.py
@@ -5,6 +5,8 @@
5# Displays system-wide system call totals, broken down by syscall. 5# Displays system-wide system call totals, broken down by syscall.
6# If a [comm] arg is specified, only syscalls called by [comm] are displayed. 6# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
7 7
8from __future__ import print_function
9
8import os 10import os
9import sys 11import sys
10 12
@@ -28,14 +30,14 @@ if len(sys.argv) > 1:
28syscalls = autodict() 30syscalls = autodict()
29 31
30def trace_begin(): 32def trace_begin():
31 print "Press control+C to stop and show the summary" 33 print("Press control+C to stop and show the summary")
32 34
33def trace_end(): 35def trace_end():
34 print_syscall_totals() 36 print_syscall_totals()
35 37
36def raw_syscalls__sys_enter(event_name, context, common_cpu, 38def raw_syscalls__sys_enter(event_name, context, common_cpu,
37 common_secs, common_nsecs, common_pid, common_comm, 39 common_secs, common_nsecs, common_pid, common_comm,
38 common_callchain, id, args): 40 common_callchain, id, args):
39 if for_comm is not None: 41 if for_comm is not None:
40 if common_comm != for_comm: 42 if common_comm != for_comm:
41 return 43 return
@@ -45,20 +47,19 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
45 syscalls[id] = 1 47 syscalls[id] = 1
46 48
47def syscalls__sys_enter(event_name, context, common_cpu, 49def syscalls__sys_enter(event_name, context, common_cpu,
48 common_secs, common_nsecs, common_pid, common_comm, 50 common_secs, common_nsecs, common_pid, common_comm, id, args):
49 id, args):
50 raw_syscalls__sys_enter(**locals()) 51 raw_syscalls__sys_enter(**locals())
51 52
52def print_syscall_totals(): 53def print_syscall_totals():
53 if for_comm is not None: 54 if for_comm is not None:
54 print "\nsyscall events for %s:\n\n" % (for_comm), 55 print("\nsyscall events for %s:\n" % (for_comm))
55 else: 56 else:
56 print "\nsyscall events:\n\n", 57 print("\nsyscall events:\n")
57 58
58 print "%-40s %10s\n" % ("event", "count"), 59 print("%-40s %10s" % ("event", "count"))
59 print "%-40s %10s\n" % ("----------------------------------------", \ 60 print("%-40s %10s" % ("----------------------------------------",
60 "-----------"), 61 "-----------"))
61 62
62 for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \ 63 for id, val in sorted(syscalls.items(),
63 reverse = True): 64 key = lambda kv: (kv[1], kv[0]), reverse = True):
64 print "%-40s %10d\n" % (syscall_name(id), val), 65 print("%-40s %10d" % (syscall_name(id), val))