rtla: Make struct trace_events double linked

The events list is currently a single linked list. New events are prepended
to the list, making them the new head.

This makes it easy to fetch the last-defined event when handling trigger
and filter options on the cmdline, as they apply to the last-defined event,
but means the events are then processed in LIFO order with regards to the
command line order.

To prepare for processing the events in the user-defined order, make the
events list double linked.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Link: https://lore.kernel.org/r/20260902123942.695822-6-vschneid@redhat.com
[ capital letter in commit message ]
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
This commit is contained in:
Valentin Schneider 2026-09-02 14:39:34 +02:00 committed by Tomas Glozar
parent edbb1d2671
commit 2f13964b43
2 changed files with 4 additions and 1 deletions

View File

@ -394,8 +394,10 @@ static int opt_event_cb(const struct option *opt, const char *arg, int unset)
if (!tevent)
fatal("Error alloc trace event");
if (*events)
if (*events) {
tevent->next = *events;
(*events)->prev = tevent;
}
*events = tevent;
return 0;

View File

@ -4,6 +4,7 @@
struct trace_events {
struct trace_events *next;
struct trace_events *prev;
char *system;
char *event;
char *filter;