lkml.org 
[lkml]   [2023]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tracing/user_events: Fix the order of the fields in the trace output
Date
Commit 4bec284cc0b9 ("tracing/user_events: Use print_format_fields() for
trace output") use print_event_fields() as safe and gives user readable
output. However, due to the insertion of the struct ftrace_event_field
structure into the field linked list from the header, the trace output
oder of fields of user events is reversed. Fix the problem by insertint
to the tail of field linked list.

Signed-off-by: sunliming <sunliming@kylinos.cn>
---
kernel/trace/trace_events_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
index aacd22c1e9f8..e9e2ec3c7613 100644
--- a/kernel/trace/trace_events_user.c
+++ b/kernel/trace/trace_events_user.c
@@ -972,7 +972,7 @@ static int user_event_add_field(struct user_event *user, const char *type,
if (filter_type == FILTER_OTHER)
field->filter_type = filter_assign_type(type);

- list_add(&field->link, &user->fields);
+ list_add_tail(&field->link, &user->fields);

/*
* Min size from user writes that are required, this does not include
--
2.25.1
\
 
 \ /
  Last update: 2023-05-25 07:41    [W:0.092 / U:1.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site