public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: sunliming <sunliming@kylinos.cn>
To: mhiramat@kernel.org, rostedt@goodmis.org, beaub@linux.microsoft.com
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kelulanainsley@gmail.com, sunliming <sunliming@kylinos.cn>
Subject: [PATCH] tracing/user_events: Fix the order of the fields in the trace output
Date: Thu, 25 May 2023 13:40:32 +0800	[thread overview]
Message-ID: <20230525054032.29392-1-sunliming@kylinos.cn> (raw)

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


             reply	other threads:[~2023-05-25  5:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25  5:40 sunliming [this message]
2023-05-25 16:53 ` [PATCH] tracing/user_events: Fix the order of the fields in the trace output Beau Belgrave
2023-05-26  1:05   ` sunliming

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=20230525054032.29392-1-sunliming@kylinos.cn \
    --to=sunliming@kylinos.cn \
    --cc=beaub@linux.microsoft.com \
    --cc=kelulanainsley@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /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