Re: [PATCH] rtla: reject -e, --filter and --trigger without --trace
From: Tomas Glozar
Date: Mon Nov 23 2026 - 10:00:01 EST
On Mon, Nov 2, 2026 at 8:03 AM Chaosheng Qu <quchaosheng000406@xxxxxxx> wrote:
>
> From: Chaosheng Qu <quchaosheng000406@xxxxxxx>
> Subject: [PATCH] rtla: reject -e, --filter and --trigger without --trace
> To: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Tomas Glozar <tglozar@xxxxxxxxxx>,
> linux-trace-kernel@xxxxxxxxxxxxxxx,
> linux-kernel@xxxxxxxxxxxxxxx
>
> -e, --filter and --trigger configure events of the trace instance that
> --trace creates, and trace_events_enable() is only called from inside the
> block that --trace or --on-end trace enters. Without either of them the
> options are parsed, stored in params->events and then never looked at
> again: rtla runs to completion and exits 0, so the user is left believing
> the events were enabled.
>
This behavior is already documented, see
Documentation/tools/rtla/common_options.txt:
**-e**, **--event** *sys:event*
Enable an event in the trace (**-t**) session. The argument can
be a specific event, e.g., **-e** *sched:sched_switch*, or
all events
of a system group, e.g., **-e** *sched*. Multiple **-e**
are allowed.
It is only active when **-t** or **-a** are set.
This option cannot be unset.
Currently, the trace is the only consumer of the events, so nothing
really breaks when the user requests the events without -t/--trace or
equivalent.
> # rtla osnoise top -e sched:sched_switch -d 1s
> ... runs for a second, exit 0, no trace file, event never enabled
>
> # rtla osnoise top -e nosuchsys:nosuchevent -d 1s
> ... exit 0, the typo goes unnoticed
>
> Reject the combination instead. This does not change what happens when
> --trace is given: an invalid event still fails with "Error enabling
> event", and a valid one still works.
>
> Signed-off-by: Chaosheng Qu <quchaosheng000406@xxxxxxx>
> ---
Any reason for not just keeping the current behavior? It has been
there ever since rtla implemented events. Changing it will break
existing uses that might always pass -e but only pass -t when needed.
I get that the behavior might be a bit counter-intuitive, but that
should be covered by the manpage.
(If anyone else has a different opinion, feel free to chime in.)
> [cut]
Tomas