tracing/eprobes: Fix reading of string fields
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 20 Aug 2022 13:43:19 +0000 (09:43 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sun, 21 Aug 2022 19:56:08 +0000 (15:56 -0400)
commitf04dec93466a0481763f3b56cdadf8076e28bfbf
treecc9f9a7f0016773cf8659dc10c104c48e7da93b3
parent02333de90e5945e2fe7fc75b15b4eb9aee187f0a
tracing/eprobes: Fix reading of string fields

Currently when an event probe (eprobe) hooks to a string field, it does
not display it as a string, but instead as a number. This makes the field
rather useless. Handle the different kinds of strings, dynamic, static,
relational/dynamic etc.

Now when a string field is used, the ":string" type can be used to display
it:

  echo "e:sw sched/sched_switch comm=$next_comm:string" > dynamic_events

Link: https://lkml.kernel.org/r/20220820134400.959640191@goodmis.org
Cc: stable@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_eprobe.c