Skip to content

Commit 7d27adf

Browse files
Tom Zanussirostedt
authored andcommitted
tracing: Don't show dynamic string internals in synthetic event description
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>
1 parent 499f7bb commit 7d27adf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

kernel/trace/trace_events_synth.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,14 +1867,22 @@ static int __synth_event_show(struct seq_file *m, struct synth_event *event)
18671867
{
18681868
struct synth_field *field;
18691869
unsigned int i;
1870+
char *type, *t;
18701871

18711872
seq_printf(m, "%s\t", event->name);
18721873

18731874
for (i = 0; i < event->n_fields; i++) {
18741875
field = event->fields[i];
18751876

1877+
type = field->type;
1878+
t = strstr(type, "__data_loc");
1879+
if (t) { /* __data_loc belongs in format but not event desc */
1880+
t += sizeof("__data_loc");
1881+
type = t;
1882+
}
1883+
18761884
/* parameter values */
1877-
seq_printf(m, "%s %s%s", field->type, field->name,
1885+
seq_printf(m, "%s %s%s", type, field->name,
18781886
i == event->n_fields - 1 ? "" : "; ");
18791887
}
18801888

0 commit comments

Comments
 (0)