diff options
author | Daniel Bristot de Oliveira <bristot@kernel.org> | 2022-02-04 19:24:03 +0300 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-02-04 20:39:28 +0300 |
commit | f35491b861290a2c8258b5f70f9bb5d5ed2a1c6f (patch) | |
tree | f7e7cc6d4f2b3595620fcb14d4fd4e3f032bd65e /tools/tracing/rtla | |
parent | 8619e32825fd0af82d243e585b9aa6917b99a975 (diff) | |
download | linux-f35491b861290a2c8258b5f70f9bb5d5ed2a1c6f.tar.xz |
rtla/utils: Fix session duration parsing
Use gmtime to format the duration time. This avoids problems when the
system uses local time different of Pisa's Local Time.
Link: https://lkml.kernel.org/r/a2f0a37bc006c2561bb8ecd871cd70532b4a9f2d.1643990447.git.bristot@kernel.org
Fixes: b1696371d865 ("rtla: Helper functions for rtla")
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/tracing/rtla')
-rw-r--r-- | tools/tracing/rtla/src/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c index 1c9f0eea6166..ffaf8ec84001 100644 --- a/tools/tracing/rtla/src/utils.c +++ b/tools/tracing/rtla/src/utils.c @@ -77,11 +77,11 @@ void get_duration(time_t start_time, char *output, int output_size) time_t duration; duration = difftime(now, start_time); - tm_info = localtime(&duration); + tm_info = gmtime(&duration); snprintf(output, output_size, "%3d %02d:%02d:%02d", tm_info->tm_yday, - tm_info->tm_hour - 1, + tm_info->tm_hour, tm_info->tm_min, tm_info->tm_sec); } |