The first is a change in the Makefile to make rtla use the kernel
version.
The other fixes are in the error path when rtla fails to enable
the tracers. I got some segmentation faults when trying to use rtla
with kernel versions that do not support multiple instances (i.e.,
5.14 and 5.15) and fixed them. I also found some inconsistency in
error messages and also did a cleanup there.
Daniel Bristot de Oliveira (4):
rtla: Follow kernel version
rtla/utils: Fix session duration parsing
rtla/trace: Error message fixup
rtla/osnoise: Fix segmentation fault when failing to enable -t
tools/tracing/rtla/Makefile | 4 +++-
tools/tracing/rtla/src/osnoise.c | 3 +++
tools/tracing/rtla/src/trace.c | 8 ++++----
tools/tracing/rtla/src/utils.c | 4 ++--
4 files changed, 12 insertions(+), 7 deletions(-)
--
2.34.1
Use gmtime to format the duration time. This avoids problems when the
system uses local time different of Pisa's Local Time.
Fixes: b1696371d865 ("rtla: Helper functions for rtla")
Cc: Daniel Bristot de Oliveira <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
---
tools/tracing/rtla/src/utils.c | 4 ++--
1 file 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);
}
--
2.34.1