Commit 7813f8e9 authored by Andrea Righi's avatar Andrea Righi Committed by yonghong-song

offwaketime: properly format "[Missed User Stack]" with folded output (#2051)

In folded output format when both kernel and user stacks are missing,
the message "[Missing User Stack]" is formatted incorrectly, for example:

chrome;entry_SYSCALL_64_after_hwframe;do_syscall_64;SyS_poll;do_sys_poll;poll_schedule_timeout;schedule_hrtimeout_range;schedule_hrtimeout_range_clock;schedule;--;[Missed Kernel Stack];[;M;i;s;s;e;d; ;U;s;e;r; ;S;t;a;c;k;];fio 4955989

This is because we're incorrectly appending the missing stack message in
the list of stack entries. Fix by appending the message as a single item.
Signed-off-by: default avatarAndrea Righi <righi.andrea@gmail.com>
parent 5b76047f
...@@ -342,7 +342,7 @@ for k, v in sorted(counts.items(), key=lambda counts: counts[1].value): ...@@ -342,7 +342,7 @@ for k, v in sorted(counts.items(), key=lambda counts: counts[1].value):
if not args.kernel_stacks_only: if not args.kernel_stacks_only:
line.extend(["-"] if (need_delimiter and k.w_u_stack_id > 0 and k.w_k_stack_id > 0) else []) line.extend(["-"] if (need_delimiter and k.w_u_stack_id > 0 and k.w_k_stack_id > 0) else [])
if stack_id_err(k.w_u_stack_id): if stack_id_err(k.w_u_stack_id):
line.extend("[Missed User Stack]") line.append("[Missed User Stack]")
else: else:
line.extend([b.sym(addr, k.w_tgid) line.extend([b.sym(addr, k.w_tgid)
for addr in reversed(list(waker_user_stack))]) for addr in reversed(list(waker_user_stack))])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment