Skip to content

Commit

Permalink
tools/wakeuptime: Reverse order of stack output
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfeng2510 authored and yonghong-song committed Apr 17, 2023
1 parent d9de47d commit 8aa3737
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/wakeuptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 14-Jan-2016 Brendan Gregg Created this.
# 03-Apr-2023 Rocky Xing Modified the order of stack output.

from __future__ import print_function
from bcc import BPF
Expand Down Expand Up @@ -242,14 +243,14 @@ def signal_ignore(signal, frame):
continue

waker_kernel_stack = [] if k.w_k_stack_id < 1 else \
reversed(list(stack_traces.walk(k.w_k_stack_id))[1:])
list(stack_traces.walk(k.w_k_stack_id))[1:]

if folded:
# print folded stack output
line = \
[k.waker] + \
[b.ksym(addr)
for addr in reversed(list(waker_kernel_stack))] + \
for addr in reversed(waker_kernel_stack)] + \
[k.target]
printb(b"%s %d" % (b";".join(line), v.value))
else:
Expand Down

0 comments on commit 8aa3737

Please sign in to comment.