]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: support "bool" type in synthetic trace events
authorAxel Rasmussen <axelrasmussen@google.com>
Fri, 9 Oct 2020 22:05:23 +0000 (15:05 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 15 Oct 2020 16:01:14 +0000 (12:01 -0400)
commit298c3a8b7e334dae561d2d834b84509f28ce4001
tree3a4e9b08918430a366a89ccf92bcc44492ceea44
parentff6239cd2cb559deb021b52bfcc0793b718aa829
tracing: support "bool" type in synthetic trace events

It's common [1] to define tracepoint fields as "bool" when they contain
a true / false value. Currently, defining a synthetic event with a
"bool" field yields EINVAL. It's possible to work around this by using
e.g. u8 (assuming sizeof(bool) is 1, and bool is unsigned; if either of
these properties don't match, you get EINVAL [2]).

Supporting "bool" explicitly makes hooking this up easier and more
portable for userspace.

[1]: grep -r "bool" include/trace/events/
[2]: check_synth_field() in kernel/trace/trace_events_hist.c

Link: https://lkml.kernel.org/r/20201009220524.485102-2-axelrasmussen@google.com
Acked-by: Michel Lespinasse <walken@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_synth.c