Skip to content

Commit

Permalink
ftrace: ftrace_format.py: display seconds
Browse files Browse the repository at this point in the history
When the time spent in a function is 1 second or more, display it as
seconds not milliseconds in order to keep the output nicely aligned.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jforissier committed May 30, 2024
1 parent f6be0e1 commit af3fb62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/ftrace_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ def format_time(ns):
if ns < 1000000:
us = ns / 1000
return f"{us:7.3f} us"
else:
elif ns < 1000000000:
ms = ns / 1000000
return f"{ms:7.3f} ms"
else:
s = ns / 1000000000
return f"{s:7.3f} s "


def display(depth, val):
Expand Down

0 comments on commit af3fb62

Please sign in to comment.