]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
tracing: Have TRACE_DEFINE_ENUM affect trace event types as well
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 11 Mar 2022 04:27:38 +0000 (23:27 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:57 +0000 (14:39 +0200)
commitec3dd1a2d3888daf1aedb19292bf9b64b489a56c
treec54ffada9232e5d348fcebc59d1ac17fb1111214
parent92a6117e527d60bb5ba30e95fb6e0df01cb777bb
tracing: Have TRACE_DEFINE_ENUM affect trace event types as well

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit b3bc8547d3be60898818885f5bf22d0a62e2eb48 ]

The macro TRACE_DEFINE_ENUM is used to convert enums in the kernel to
their actual value when they are exported to user space via the trace
event format file.

Currently only the enums in the "print fmt" (TP_printk in the TRACE_EVENT
macro) have the enums converted. But the enums can be used to denote array
size:

        field:unsigned int fc_ineligible_rc[EXT4_FC_REASON_MAX]; offset:12;      size:36;        signed:0;

The EXT4_FC_REASON_MAX has no meaning to userspace but it needs to know
that information to know how to parse the array.

Have the array indexes also be parsed as well.

Link: https://lore.kernel.org/all/cover.1646922487.git.riteshh@linux.ibm.com/
Reported-by: Ritesh Harjani <riteshh@linux.ibm.com>
Tested-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7c6bd60999f32138e3b73fd97ea11ef47a94de25)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
kernel/trace/trace_events.c