* [PATCH] rtla: clarify trace option syntax in documentation and usage help
@ 2025-07-23 1:52 Ivan Pravdin
2025-07-24 13:56 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Pravdin @ 2025-07-23 1:52 UTC (permalink / raw)
To: bristot, rostedt, corbet, linux-trace-kernel, linux-doc,
linux-kernel
Cc: Ivan Pravdin
When using `rtla timerlat {top,hist}`, the `-t/--trace` option is
optional. However, when providing a filename, the long option requires
an equal sign (`=`), i.e., `--trace=<file>`. This is because the
command-line parser treats `--trace` without `=` as a flag with no
value, leading to unexpected behavior.
Valid usage:
- `-t[file]`
- `-t=[file]`
- `--trace=[file]`
Invalid usage:
- `-t [file]`
- `--trace [file]`
Clarify valid usage in documentation and help message.
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
---
Documentation/tools/rtla/common_osnoise_options.rst | 2 +-
Documentation/tools/rtla/common_timerlat_options.rst | 2 +-
tools/tracing/rtla/src/timerlat_hist.c | 2 +-
tools/tracing/rtla/src/timerlat_top.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/tools/rtla/common_osnoise_options.rst b/Documentation/tools/rtla/common_osnoise_options.rst
index d73de2d58f5f..0b73a55f1d1f 100644
--- a/Documentation/tools/rtla/common_osnoise_options.rst
+++ b/Documentation/tools/rtla/common_osnoise_options.rst
@@ -26,6 +26,6 @@
Specify the minimum delta between two time reads to be considered noise.
The default threshold is *5 us*.
-**-t**, **--trace** \[*file*]
+**-t**, **--trace**=\[*file*]
Save the stopped trace to [*file|osnoise_trace.txt*].
diff --git a/Documentation/tools/rtla/common_timerlat_options.rst b/Documentation/tools/rtla/common_timerlat_options.rst
index 10dc802f8d65..8d55b590c7d0 100644
--- a/Documentation/tools/rtla/common_timerlat_options.rst
+++ b/Documentation/tools/rtla/common_timerlat_options.rst
@@ -22,7 +22,7 @@
Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
argument in us.
-**-t**, **--trace** \[*file*]
+**-t**, **--trace**=\[*file*]
Save the stopped trace to [*file|timerlat_trace.txt*].
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index 36d2294c963d..b6e1275b0e71 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -730,7 +730,7 @@ static void timerlat_hist_usage(char *usage)
" -d/--duration time[m|h|d]: duration of the session in seconds",
" --dump-tasks: prints the task running on all CPUs if stop conditions are met (depends on !--no-aa)",
" -D/--debug: print debug info",
- " -t/--trace[file]: save the stopped trace to [file|timerlat_trace.txt]",
+ " -t/--trace=[file]: save the stopped trace to [file|timerlat_trace.txt]",
" -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
" --filter <filter>: enable a trace event filter to the previous -e event",
" --trigger <trigger>: enable a trace event trigger to the previous -e event",
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index 7365e08fe986..19ee98456e3f 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -496,7 +496,7 @@ static void timerlat_top_usage(char *usage)
" -d/--duration time[s|m|h|d]: duration of the session",
" -D/--debug: print debug info",
" --dump-tasks: prints the task running on all CPUs if stop conditions are met (depends on !--no-aa)",
- " -t/--trace[file]: save the stopped trace to [file|timerlat_trace.txt]",
+ " -t/--trace=[file]: save the stopped trace to [file|timerlat_trace.txt]",
" -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
" --filter <command>: enable a trace event filter to the previous -e event",
" --trigger <command>: enable a trace event trigger to the previous -e event",
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtla: clarify trace option syntax in documentation and usage help
2025-07-23 1:52 [PATCH] rtla: clarify trace option syntax in documentation and usage help Ivan Pravdin
@ 2025-07-24 13:56 ` Steven Rostedt
2025-07-25 9:13 ` Tomas Glozar
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2025-07-24 13:56 UTC (permalink / raw)
To: Ivan Pravdin; +Cc: bristot, corbet, linux-trace-kernel, linux-doc, linux-kernel
On Tue, 22 Jul 2025 21:52:33 -0400
Ivan Pravdin <ipravdin.official@gmail.com> wrote:
> When using `rtla timerlat {top,hist}`, the `-t/--trace` option is
> optional. However, when providing a filename, the long option requires
> an equal sign (`=`), i.e., `--trace=<file>`. This is because the
> command-line parser treats `--trace` without `=` as a flag with no
> value, leading to unexpected behavior.
>
> Valid usage:
> - `-t[file]`
> - `-t=[file]`
> - `--trace=[file]`
>
> Invalid usage:
> - `-t [file]`
> - `--trace [file]`
I wonder if the better fix would be to make the above valid?
-- Steve
>
> Clarify valid usage in documentation and help message.
>
> Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rtla: clarify trace option syntax in documentation and usage help
2025-07-24 13:56 ` Steven Rostedt
@ 2025-07-25 9:13 ` Tomas Glozar
0 siblings, 0 replies; 3+ messages in thread
From: Tomas Glozar @ 2025-07-25 9:13 UTC (permalink / raw)
To: Steven Rostedt
Cc: Ivan Pravdin, bristot, corbet, linux-trace-kernel, linux-doc,
linux-kernel
čt 24. 7. 2025 v 15:59 odesílatel Steven Rostedt <rostedt@goodmis.org> napsal:
>
> On Tue, 22 Jul 2025 21:52:33 -0400
> Ivan Pravdin <ipravdin.official@gmail.com> wrote:
> > Valid usage:
> > - `-t[file]`
> > - `-t=[file]`
> > - `--trace=[file]`
> >
> > Invalid usage:
> > - `-t [file]`
> > - `--trace [file]`
>
> I wonder if the better fix would be to make the above valid?
>
Definitely. There is also another case where only = syntax is
accepted, C/--cgroup. In my opinion, both are confusing, and both
should accept = as well as space. I even had some trouble with the
latter as it fails to parse silently and looks like the cgroup setting
code is not working.
Tomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-25 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 1:52 [PATCH] rtla: clarify trace option syntax in documentation and usage help Ivan Pravdin
2025-07-24 13:56 ` Steven Rostedt
2025-07-25 9:13 ` Tomas Glozar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).