Re: [PATCH] perf script: introduce deltatime option
From: Arnaldo Carvalho de Melo
Date: Thu Mar 26 2020 - 10:34:01 EST
Em Tue, Feb 04, 2020 at 06:37:09PM +0100, Hagen Paul Pfeifer escreveu:
> For some kind of analysis a deltatime output is more human friendly and reduce
> the cognitive load for further analysis.
>
> The following output demonstrate the new option "deltatime": calculate
> the time difference in relation to the previous event.
>
> $ perf script --deltatime
> test 2525 [001] 0.000000: sdt_libev:ev_add: (5635e72a5ebd)
> test 2525 [001] 0.000091: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 1.000051: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
> test 2525 [001] 0.000685: sdt_libev:ev_add: (5635e72a5ebd)
> test 2525 [001] 0.000048: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 1.000104: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
> test 2525 [001] 0.003895: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 0.996034: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
> test 2525 [001] 0.000058: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 1.000004: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
> test 2525 [001] 0.000064: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 0.999934: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
> test 2525 [001] 0.000056: sdt_libev:epoll_wait_enter: (5635e72a76a9)
> test 2525 [001] 0.999930: sdt_libev:epoll_wait_return: (5635e72a772e) arg1=1
You forgot to update the man page, I did it, tested and applied, thanks.
- Arnaldo
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index db6a36aac47e..4af255bb0977 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -390,6 +390,9 @@ include::itrace.txt[]
--reltime::
Print time stamps relative to trace start.
+--deltatime::
+ Print time stamps relative to previous event.
+
--per-event-dump::
Create per event files with a "perf.data.EVENT.dump" name instead of
printing to stdout, useful, for instance, for generating flamegraphs.