mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
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:
parent
c1d3e633e1
commit
b504d7f687
14 changed files with 128 additions and 127 deletions
|
@ -33,8 +33,7 @@ def irq__softirq_entry(event_name, context, common_cpu,
|
||||||
|
|
||||||
print_uncommon(context)
|
print_uncommon(context)
|
||||||
|
|
||||||
print "vec=%s\n" % \
|
print "vec=%s\n" % (symbol_str("irq__softirq_entry", "vec", vec)),
|
||||||
(symbol_str("irq__softirq_entry", "vec", vec)),
|
|
||||||
|
|
||||||
def kmem__kmalloc(event_name, context, common_cpu,
|
def kmem__kmalloc(event_name, context, common_cpu,
|
||||||
common_secs, common_nsecs, common_pid, common_comm,
|
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, " \
|
print "call_site=%u, ptr=%u, bytes_req=%u, " \
|
||||||
"bytes_alloc=%u, gfp_flags=%s\n" % \
|
"bytes_alloc=%u, gfp_flags=%s\n" % \
|
||||||
(call_site, ptr, bytes_req, bytes_alloc,
|
(call_site, ptr, bytes_req, bytes_alloc,
|
||||||
|
|
||||||
flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
|
flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
|
||||||
|
|
||||||
def trace_unhandled(event_name, context, event_fields_dict):
|
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
|
# print trace fields not included in handler args
|
||||||
def print_uncommon(context):
|
def print_uncommon(context):
|
||||||
print "common_preempt_count=%d, common_flags=%s, common_lock_depth=%d, " \
|
print "common_preempt_count=%d, common_flags=%s, " \
|
||||||
% (common_pc(context), trace_flag_str(common_flags(context)), \
|
"common_lock_depth=%d, " % \
|
||||||
|
(common_pc(context), trace_flag_str(common_flags(context)),
|
||||||
common_lock_depth(context))
|
common_lock_depth(context))
|
||||||
|
|
||||||
def print_unhandled():
|
def print_unhandled():
|
||||||
|
|
|
@ -48,7 +48,8 @@ def print_memory_type():
|
||||||
total = sum(load_mem_type_cnt.values())
|
total = sum(load_mem_type_cnt.values())
|
||||||
for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
|
for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
|
||||||
key = lambda kv: (kv[1], kv[0]), reverse = True):
|
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='')
|
end='')
|
||||||
|
|
||||||
def trace_begin():
|
def trace_begin():
|
||||||
|
|
|
@ -124,14 +124,16 @@ def print_receive(hunk):
|
||||||
event = event_list[i]
|
event = event_list[i]
|
||||||
if event['event_name'] == 'napi_poll':
|
if event['event_name'] == 'napi_poll':
|
||||||
print(PF_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:
|
if i == len(event_list) - 1:
|
||||||
print("")
|
print("")
|
||||||
else:
|
else:
|
||||||
print(PF_JOINT)
|
print(PF_JOINT)
|
||||||
else:
|
else:
|
||||||
print(PF_NET_RECV %
|
print(PF_NET_RECV %
|
||||||
(diff_msec(base_t, event['event_t']), event['skbaddr'],
|
(diff_msec(base_t, event['event_t']),
|
||||||
|
event['skbaddr'],
|
||||||
event['len']))
|
event['len']))
|
||||||
if 'comm' in event.keys():
|
if 'comm' in event.keys():
|
||||||
print(PF_WJOINT)
|
print(PF_WJOINT)
|
||||||
|
|
|
@ -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):
|
reverse = True):
|
||||||
try:
|
try:
|
||||||
print("%-40s %10d" % (syscall_name(id), val))
|
print("%-40s %10d" % (syscall_name(id), val))
|
||||||
|
|
|
@ -41,7 +41,6 @@ def trace_end():
|
||||||
def raw_syscalls__sys_enter(event_name, context, common_cpu,
|
def raw_syscalls__sys_enter(event_name, context, common_cpu,
|
||||||
common_secs, common_nsecs, common_pid, common_comm,
|
common_secs, common_nsecs, common_pid, common_comm,
|
||||||
common_callchain, id, args):
|
common_callchain, id, args):
|
||||||
|
|
||||||
if (for_comm and common_comm != for_comm) or \
|
if (for_comm and common_comm != for_comm) or \
|
||||||
(for_pid and common_pid != for_pid ):
|
(for_pid and common_pid != for_pid ):
|
||||||
return
|
return
|
||||||
|
@ -71,6 +70,6 @@ def print_syscall_totals():
|
||||||
for pid in pid_keys:
|
for pid in pid_keys:
|
||||||
print("\n%s [%d]" % (comm, pid))
|
print("\n%s [%d]" % (comm, pid))
|
||||||
id_keys = syscalls[comm][pid].keys()
|
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):
|
key = lambda kv: (kv[1], kv[0]), reverse = True):
|
||||||
print(" %-38s %10d" % (syscall_name(id), val))
|
print(" %-38s %10d" % (syscall_name(id), val))
|
||||||
|
|
|
@ -47,8 +47,7 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
|
||||||
syscalls[id] = 1
|
syscalls[id] = 1
|
||||||
|
|
||||||
def syscalls__sys_enter(event_name, context, common_cpu,
|
def syscalls__sys_enter(event_name, context, common_cpu,
|
||||||
common_secs, common_nsecs, common_pid, common_comm,
|
common_secs, common_nsecs, common_pid, common_comm, id, args):
|
||||||
id, args):
|
|
||||||
raw_syscalls__sys_enter(**locals())
|
raw_syscalls__sys_enter(**locals())
|
||||||
|
|
||||||
def print_syscall_totals():
|
def print_syscall_totals():
|
||||||
|
@ -61,6 +60,6 @@ def print_syscall_totals():
|
||||||
print("%-40s %10s" % ("----------------------------------------",
|
print("%-40s %10s" % ("----------------------------------------",
|
||||||
"-----------"))
|
"-----------"))
|
||||||
|
|
||||||
for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
|
for id, val in sorted(syscalls.items(),
|
||||||
reverse = True):
|
key = lambda kv: (kv[1], kv[0]), reverse = True):
|
||||||
print("%-40s %10d" % (syscall_name(id), val))
|
print("%-40s %10d" % (syscall_name(id), val))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue