Re: [PATCH] perf script: introduce deltatime option

From: Hagen Paul Pfeifer
Date: Wed Feb 05 2020 - 04:14:24 EST


* Andi Kleen | 2020-02-04 15:16:28 [-0800]:

>> $ perf script --deltatime
>
>It's already implemented as --reltime

Nope ;-)

$ perf script --ns --reltime
sleep 49148 [000] 0.000000000: probe_libc:sbrk: (7f279d9144f0)
sleep 49148 [000] 0.000009153: probe_libc:sbrk: (7f279d9144f0)
sh 49151 [002] 0.099454082: probe_libc:sbrk: (7f9f1c6374f0)
sh 49151 [002] 0.099468538: probe_libc:sbrk: (7f9f1c6374f0)
curl 49153 [003] 0.114459574: probe_libc:sbrk: (7f9bb2dfb4f0)
curl 49153 [003] 0.114474449: probe_libc:sbrk: (7f9bb2dfb4f0)
[...]

$ perf script --ns --deltatime
sleep 49148 [000] 0.000000000: probe_libc:sbrk: (7f279d9144f0)
sleep 49148 [000] 0.000009153: probe_libc:sbrk: (7f279d9144f0)
sh 49151 [002] 0.099444929: probe_libc:sbrk: (7f9f1c6374f0)
sh 49151 [002] 0.000014456: probe_libc:sbrk: (7f9f1c6374f0)
curl 49153 [003] 0.014991036: probe_libc:sbrk: (7f9bb2dfb4f0)
curl 49153 [003] 0.000014875: probe_libc:sbrk: (7f9bb2dfb4f0)
[...]


reltime is relative to the *first event* in the record - deltatime is relative
to the *previous* event.

Hagen