All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Tom Zanussi <zanussi@kernel.org>
Subject: [for-next][PATCH 05/12] tracing: Dont show dynamic string internals in synthetic event description
Date: Wed, 14 Oct 2020 13:36:52 -0400	[thread overview]
Message-ID: <20201014173728.806837346@goodmis.org> (raw)
In-Reply-To: 20201014173647.955053902@goodmis.org

From: Tom Zanussi <zanussi@kernel.org>

For synthetic event dynamic fields, the type contains "__data_loc",
which is basically an internal part of the type which is only meant to
be displayed in the format, not in the event description itself, which
is confusing to users since they can't use __data_loc on the
command-line to define an event field, which printing it would lead
them to believe.

So filter it out from the description, while leaving it in the type.

Link: https://lkml.kernel.org/r/b3b7baf7813298a5ede4ff02e2e837b91c05a724.1602598160.git.zanussi@kernel.org

Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace_events_synth.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 3b2dcc42b8ee..b19e2f4159ab 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -1867,14 +1867,22 @@ static int __synth_event_show(struct seq_file *m, struct synth_event *event)
 {
 	struct synth_field *field;
 	unsigned int i;
+	char *type, *t;
 
 	seq_printf(m, "%s\t", event->name);
 
 	for (i = 0; i < event->n_fields; i++) {
 		field = event->fields[i];
 
+		type = field->type;
+		t = strstr(type, "__data_loc");
+		if (t) { /* __data_loc belongs in format but not event desc */
+			t += sizeof("__data_loc");
+			type = t;
+		}
+
 		/* parameter values */
-		seq_printf(m, "%s %s%s", field->type, field->name,
+		seq_printf(m, "%s %s%s", type, field->name,
 			   i == event->n_fields - 1 ? "" : "; ");
 	}
 
-- 
2.28.0



  parent reply	other threads:[~2020-10-14 17:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 17:36 [for-next][PATCH 00/12] tracing: Last minute updates before sending to Linus Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 01/12] tracing: Check return value of __create_val_fields() before using its result Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 02/12] tracing: Fix race in trace_open and buffer resize call Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 03/12] tracing/boot: Add ftrace.instance.*.alloc_snapshot option Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 04/12] tracing: Fix some typos in comments Steven Rostedt
2020-10-14 17:36 ` Steven Rostedt [this message]
2020-10-14 17:36 ` [for-next][PATCH 06/12] tracing: Move is_good_name() from trace_probe.h to trace.h Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 07/12] tracing: Check that the synthetic event and field names are legal Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 08/12] tracing: Add synthetic event error logging Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 09/12] selftests/ftrace: Change synthetic event name for inter-event-combined test Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 10/12] tracing: Handle synthetic event array field type checking correctly Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 11/12] selftests/ftrace: Add test case for synthetic event syntax errors Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 12/12] tracing: support "bool" type in synthetic trace events Steven Rostedt

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=20201014173728.806837346@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=zanussi@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.