From af3fb62410645ac9636d27c3d1db72c0c9fca913 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Wed, 29 May 2024 17:24:57 +0200 Subject: [PATCH] ftrace: ftrace_format.py: display seconds 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 Reviewed-by: Joakim Bech Acked-by: Jens Wiklander --- scripts/ftrace_format.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ftrace_format.py b/scripts/ftrace_format.py index 50a947db870..b1f16c4636d 100755 --- a/scripts/ftrace_format.py +++ b/scripts/ftrace_format.py @@ -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):