From: Ivan Pravdin <ipravdin.official@gmail.com>
To: rostedt@goodmis.org, tglozar@redhat.com,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>
Subject: [PATCH v3 3/3] rtla: fix -a overriding -t argument
Date: Sun, 7 Sep 2025 22:05:59 -0400 [thread overview]
Message-ID: <e4a61cf3416c9b2a2c4952cbc93b4b05a7c3a37e.1757034919.git.ipravdin.official@gmail.com> (raw)
In-Reply-To: <cover.1757034919.git.ipravdin.official@gmail.com>
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@gmail.com>
---
tools/tracing/rtla/src/osnoise_hist.c | 3 ++-
tools/tracing/rtla/src/osnoise_top.c | 3 ++-
tools/tracing/rtla/src/timerlat_hist.c | 3 ++-
tools/tracing/rtla/src/timerlat_top.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index 1dc39de79d78..3aa74affac26 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -543,7 +543,8 @@ static struct osnoise_params
params->threshold = 1;
/* set trace */
- params->trace_output = "osnoise_trace.txt";
+ if (!params->trace_output)
+ params->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 b3e161536ed8..6bcb8d10c342 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -383,7 +383,8 @@ struct osnoise_params *osnoise_top_parse_args(int argc, char **argv)
params->threshold = 1;
/* set trace */
- params->trace_output = "osnoise_trace.txt";
+ if (!params->trace_output)
+ params->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 ad713dafa3c3..f845d5fa8141 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -874,7 +874,8 @@ static struct timerlat_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 7f1885018624..42d85ea2e996 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -625,7 +625,8 @@ static struct timerlat_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
next prev parent reply other threads:[~2025-09-08 2:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 2:05 [PATCH v3 0/3] rtla: fix cgroup and trace options parsing Ivan Pravdin
2025-09-08 2:05 ` [PATCH v3 1/3] rtla: fix buffer overflow in actions_parse Ivan Pravdin
2025-09-26 14:32 ` Tomas Glozar
2025-09-27 9:59 ` Steven Rostedt
2025-09-29 15:13 ` Ivan Pravdin
2025-09-08 2:05 ` [PATCH v3 2/3] rtla: fix -C/--cgroup interface Ivan Pravdin
2025-09-11 11:29 ` Tomas Glozar
2025-09-08 2:05 ` Ivan Pravdin [this message]
2025-09-11 11:32 ` [PATCH v3 3/3] rtla: fix -a overriding -t argument Tomas Glozar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4a61cf3416c9b2a2c4952cbc93b4b05a7c3a37e.1757034919.git.ipravdin.official@gmail.com \
--to=ipravdin.official@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglozar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox