aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/check-perf-trace.py
diff options
context:
space:
mode:
authorTony Jones <tonyj@suse.de>2019-03-01 20:18:57 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-03-06 16:09:14 -0500
commitb504d7f6876515b74c8e27a44ccdb22372616d97 (patch)
treec0591cd27231c653655fdb5b9849582e286168b9 /tools/perf/scripts/python/check-perf-trace.py
parentc1d3e633e16db3eb64f519c7099171bfcef94b20 (diff)
perf script python: Remove mixed indentation
Remove mixed indentation in Python scripts. Revert to either all tabs (most common form) or all spaces (4 or 8) depending on what was the intent of the original commit. This is necessary to complete Python3 support as it will flag an error if it encounters mixed indentation. Signed-off-by: Tony Jones <tonyj@suse.de> Link: http://lkml.kernel.org/r/20190302011903.2416-2-tonyj@suse.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
-rw-r--r--tools/perf/scripts/python/check-perf-trace.py65
1 files changed, 32 insertions, 33 deletions
diff --git a/tools/perf/scripts/python/check-perf-trace.py b/tools/perf/scripts/python/check-perf-trace.py
index 334599c6032c..f4838db3e518 100644
--- a/tools/perf/scripts/python/check-perf-trace.py
+++ b/tools/perf/scripts/python/check-perf-trace.py
@@ -23,60 +23,59 @@ def trace_begin():
23 pass 23 pass
24 24
25def trace_end(): 25def trace_end():
26 print_unhandled() 26 print_unhandled()
27 27
28def irq__softirq_entry(event_name, context, common_cpu, 28def irq__softirq_entry(event_name, context, common_cpu,
29 common_secs, common_nsecs, common_pid, common_comm, 29 common_secs, common_nsecs, common_pid, common_comm,
30 common_callchain, vec): 30 common_callchain, vec):
31 print_header(event_name, common_cpu, common_secs, common_nsecs, 31 print_header(event_name, common_cpu, common_secs, common_nsecs,
32 common_pid, common_comm) 32 common_pid, common_comm)
33 33
34 print_uncommon(context) 34 print_uncommon(context)
35 35
36 print "vec=%s\n" % \ 36 print "vec=%s\n" % (symbol_str("irq__softirq_entry", "vec", vec)),
37 (symbol_str("irq__softirq_entry", "vec", vec)),
38 37
39def kmem__kmalloc(event_name, context, common_cpu, 38def kmem__kmalloc(event_name, context, common_cpu,
40 common_secs, common_nsecs, common_pid, common_comm, 39 common_secs, common_nsecs, common_pid, common_comm,
41 common_callchain, call_site, ptr, bytes_req, bytes_alloc, 40 common_callchain, call_site, ptr, bytes_req, bytes_alloc,
42 gfp_flags): 41 gfp_flags):
43 print_header(event_name, common_cpu, common_secs, common_nsecs, 42 print_header(event_name, common_cpu, common_secs, common_nsecs,
44 common_pid, common_comm) 43 common_pid, common_comm)
45 44
46 print_uncommon(context) 45 print_uncommon(context)
47 46
48 print "call_site=%u, ptr=%u, bytes_req=%u, " \ 47 print "call_site=%u, ptr=%u, bytes_req=%u, " \
49 "bytes_alloc=%u, gfp_flags=%s\n" % \ 48 "bytes_alloc=%u, gfp_flags=%s\n" % \
50 (call_site, ptr, bytes_req, bytes_alloc, 49 (call_site, ptr, bytes_req, bytes_alloc,
51
52 flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)), 50 flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
53 51
54def trace_unhandled(event_name, context, event_fields_dict): 52def trace_unhandled(event_name, context, event_fields_dict):
55 try: 53 try:
56 unhandled[event_name] += 1 54 unhandled[event_name] += 1
57 except TypeError: 55 except TypeError:
58 unhandled[event_name] = 1 56 unhandled[event_name] = 1
59 57
60def print_header(event_name, cpu, secs, nsecs, pid, comm): 58def print_header(event_name, cpu, secs, nsecs, pid, comm):
61 print "%-20s %5u %05u.%09u %8u %-20s " % \ 59 print "%-20s %5u %05u.%09u %8u %-20s " % \
62 (event_name, cpu, secs, nsecs, pid, comm), 60 (event_name, cpu, secs, nsecs, pid, comm),
63 61
64# print trace fields not included in handler args 62# print trace fields not included in handler args
65def print_uncommon(context): 63def print_uncommon(context):
66 print "common_preempt_count=%d, common_flags=%s, common_lock_depth=%d, " \ 64 print "common_preempt_count=%d, common_flags=%s, " \
67 % (common_pc(context), trace_flag_str(common_flags(context)), \ 65 "common_lock_depth=%d, " % \
68 common_lock_depth(context)) 66 (common_pc(context), trace_flag_str(common_flags(context)),
67 common_lock_depth(context))
69 68
70def print_unhandled(): 69def print_unhandled():
71 keys = unhandled.keys() 70 keys = unhandled.keys()
72 if not keys: 71 if not keys:
73 return 72 return
74 73
75 print "\nunhandled events:\n\n", 74 print "\nunhandled events:\n\n",
76 75
77 print "%-40s %10s\n" % ("event", "count"), 76 print "%-40s %10s\n" % ("event", "count"),
78 print "%-40s %10s\n" % ("----------------------------------------", \ 77 print "%-40s %10s\n" % ("----------------------------------------", \
79 "-----------"), 78 "-----------"),
80 79
81 for event_name in keys: 80 for event_name in keys:
82 print "%-40s %10d\n" % (event_name, unhandled[event_name]) 81 print "%-40s %10d\n" % (event_name, unhandled[event_name])