[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <93cf8411e8c23ebdcf2e168f0f7d3e8c9081900b.1760791697.git.ipravdin.official@gmail.com>
Date: Sat, 18 Oct 2025 09:04:31 -0400
From: Ivan Pravdin <ipravdin.official@...il.com>
To: rostedt@...dmis.org,
tglozar@...hat.com,
linux-trace-kernel@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Ivan Pravdin <ipravdin.official@...il.com>
Subject: [PATCH v4 2/2] rtla: fix -a overriding -t argument
When running rtla as
`rtla <timerlat|osnoise> <top|hist> -t custom_file.txt -a 100`
-a options override trace output filename specified by -t option.
Running the command above will create <timerlat|osnoise>_trace.txt file
instead of custom_file.txt. Fix this by making sure that -a option does
not override trace output filename even if it's passed after trace
output filename is specified.
Fixes: 173a3b014827 ("rtla/timerlat: Add the automatic trace option")
Signed-off-by: Ivan Pravdin <ipravdin.official@...il.com>
Reviewed-by: Tomas Glozar <tglozar@...hat.com>
---
tools/tracing/rtla/src/osnoise_hist.c | 3 ++-
tools/tracing/rtla/src/osnoise_top.c | 2 ++
tools/tracing/rtla/src/timerlat_hist.c | 3 ++-
tools/tracing/rtla/src/timerlat_top.c | 3 ++-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index 8b12d8803998..ae8426f40f8f 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -557,7 +557,8 @@ static struct common_params
params->threshold = 1;
/* set trace */
- trace_output = "osnoise_trace.txt";
+ if (!trace_output)
+ trace_output = "osnoise_trace.txt";
break;
case 'b':
diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
index 0be400666c05..9487c6a592c2 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -398,6 +398,8 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
/* set trace */
trace_output = "osnoise_trace.txt";
+ if (!trace_output)
+ trace_output = "osnoise_trace.txt";
break;
case 'c':
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index 16416192e432..311c4f18ce4c 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -878,7 +878,8 @@ static struct common_params
params->print_stack = auto_thresh;
/* set trace */
- trace_output = "timerlat_trace.txt";
+ if (!trace_output)
+ trace_output = "timerlat_trace.txt";
break;
case 'c':
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index fe4f4e69e00f..3a3b11b5beaa 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -628,7 +628,8 @@ static struct common_params
params->print_stack = auto_thresh;
/* set trace */
- trace_output = "timerlat_trace.txt";
+ if (!trace_output)
+ trace_output = "timerlat_trace.txt";
break;
case '5':
--
2.48.1
Powered by blists - more mailing lists