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>
This commit is contained in:
Tony Jones 2019-03-01 17:18:57 -08:00 committed by Arnaldo Carvalho de Melo
parent c1d3e633e1
commit b504d7f687
14 changed files with 128 additions and 127 deletions

View File

@ -33,8 +33,7 @@ def irq__softirq_entry(event_name, context, common_cpu,
print_uncommon(context)
print "vec=%s\n" % \
(symbol_str("irq__softirq_entry", "vec", vec)),
print "vec=%s\n" % (symbol_str("irq__softirq_entry", "vec", vec)),
def kmem__kmalloc(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
@ -48,7 +47,6 @@ def kmem__kmalloc(event_name, context, common_cpu,
print "call_site=%u, ptr=%u, bytes_req=%u, " \
"bytes_alloc=%u, gfp_flags=%s\n" % \
(call_site, ptr, bytes_req, bytes_alloc,
flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
def trace_unhandled(event_name, context, event_fields_dict):
@ -63,8 +61,9 @@ def print_header(event_name, cpu, secs, nsecs, pid, comm):
# print trace fields not included in handler args
def print_uncommon(context):
print "common_preempt_count=%d, common_flags=%s, common_lock_depth=%d, " \
% (common_pc(context), trace_flag_str(common_flags(context)), \
print "common_preempt_count=%d, common_flags=%s, " \
"common_lock_depth=%d, " % \
(common_pc(context), trace_flag_str(common_flags(context)),
common_lock_depth(context))
def print_unhandled():

View File

@ -48,7 +48,8 @@ def print_memory_type():
total = sum(load_mem_type_cnt.values())
for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
key = lambda kv: (kv[1], kv[0]), reverse = True):
print("%-40s %10d %10.1f%%\n" % (mem_type, count, 100 * count / total),
print("%-40s %10d %10.1f%%\n" %
(mem_type, count, 100 * count / total),
end='')
def trace_begin():

View File

@ -124,14 +124,16 @@ def print_receive(hunk):
event = event_list[i]
if event['event_name'] == 'napi_poll':
print(PF_NAPI_POLL %
(diff_msec(base_t, event['event_t']), event['dev']))
(diff_msec(base_t, event['event_t']),
event['dev']))
if i == len(event_list) - 1:
print("")
else:
print(PF_JOINT)
else:
print(PF_NET_RECV %
(diff_msec(base_t, event['event_t']), event['skbaddr'],
(diff_msec(base_t, event['event_t']),
event['skbaddr'],
event['len']))
if 'comm' in event.keys():
print(PF_WJOINT)

View File

@ -78,7 +78,8 @@ def print_syscall_totals(interval):
("----------------------------------------",
"----------"))
for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
for id, val in sorted(syscalls.items(),
key = lambda kv: (kv[1], kv[0]),
reverse = True):
try:
print("%-40s %10d" % (syscall_name(id), val))

View File

@ -41,7 +41,6 @@ def trace_end():
def raw_syscalls__sys_enter(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
common_callchain, id, args):
if (for_comm and common_comm != for_comm) or \
(for_pid and common_pid != for_pid ):
return
@ -71,6 +70,6 @@ def print_syscall_totals():
for pid in pid_keys:
print("\n%s [%d]" % (comm, pid))
id_keys = syscalls[comm][pid].keys()
for id, val in sorted(syscalls[comm][pid].items(), \
for id, val in sorted(syscalls[comm][pid].items(),
key = lambda kv: (kv[1], kv[0]), reverse = True):
print(" %-38s %10d" % (syscall_name(id), val))

View File

@ -47,8 +47,7 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
syscalls[id] = 1
def syscalls__sys_enter(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
id, args):
common_secs, common_nsecs, common_pid, common_comm, id, args):
raw_syscalls__sys_enter(**locals())
def print_syscall_totals():
@ -61,6 +60,6 @@ def print_syscall_totals():
print("%-40s %10s" % ("----------------------------------------",
"-----------"))
for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
reverse = True):
for id, val in sorted(syscalls.items(),
key = lambda kv: (kv[1], kv[0]), reverse = True):
print("%-40s %10d" % (syscall_name(id), val))