namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
2.92k stars 419 forks source link

info: Add utc_offset info for external usage #1923

Closed honggyukim closed 1 month ago

honggyukim commented 1 month ago

In some cases, there is a requirement to get the time offset between UTC time and our timestamp from the given clock source, CLOCK_MONOTONIC by default.

This patch provides an additional info to provide UTC time offset in the output of uftrace info.

This number can be used to make time adjustment easier for external tools such as tracecompass[1].

Closes: #1916

[1] https://eclipse.dev/tracecompass Requested-by: Matthew Khouzam matthew.khouzam@gmail.com Signed-off-by: Honggyu Kim honggyu.kp@gmail.com

honggyukim commented 1 month ago

This patch is to make the UTC time adjustment easier than https://youtu.be/KtVdeHfD45o?si=hIMvE10XI87XqXIW.

honggyukim commented 1 month ago

The remaing job is to make this feature doesn't break previously recorded data to support backward compatibility.

honggyukim commented 1 month ago

I just fixed uftrace dump crash with https://github.com/namhyung/uftrace/compare/96da52d61136ba055102603644318eedee75562c..5d83c874643b4668f99092faf7ff8c23f8803fe5.

@namhyung @MatthewKhouzam I think it's good to be merged now. Please have a look.