Skip to content

Commit

Permalink
tools/profile: fix kernel delimiter when folding (iovisor#2758)
Browse files Browse the repository at this point in the history
retain delimiter with folding enabled
  • Loading branch information
graphaelli committed Feb 19, 2020
1 parent 51be481 commit 29aa619
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ def aksym(addr):
has_enomem = False
counts = b.get_table("counts")
stack_traces = b.get_table("stack_traces")
need_delimiter = args.delimited and not (args.kernel_stacks_only or
args.user_stacks_only)
for k, v in sorted(counts.items(), key=lambda counts: counts[1].value):
# handle get_stackid errors
if not args.user_stacks_only and stack_id_err(k.kernel_stack_id):
Expand Down Expand Up @@ -334,7 +332,7 @@ def aksym(addr):
else:
line.extend([b.sym(addr, k.pid) for addr in reversed(user_stack)])
if not args.user_stacks_only:
line.extend(b["-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else [])
line.extend([b"-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else [])
if stack_id_err(k.kernel_stack_id):
line.append(b"[Missed Kernel Stack]")
else:
Expand Down

0 comments on commit 29aa619

Please sign in to comment.