tracing/synthetic: Use union instead of casts
authorSven Schnelle <svens@linux.ibm.com>
Wed, 16 Aug 2023 15:49:26 +0000 (17:49 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 16 Aug 2023 20:33:27 +0000 (16:33 -0400)
commitddeea494a16f32522bce16ee65f191d05d4b8282
tree2de190925a4e1eb0b4cac6bc6d9f7746f74f8fca
parent5450be6befc63670f2c05aa6773a8e437b39a3fe
tracing/synthetic: Use union instead of casts

The current code uses a lot of casts to access the fields member in struct
synth_trace_events with different sizes.  This makes the code hard to
read, and had already introduced an endianness bug. Use a union and struct
instead.

Link: https://lkml.kernel.org/r/20230816154928.4171614-2-svens@linux.ibm.com
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 00cf3d672a9dd ("tracing: Allow synthetic events to pass around stacktraces")
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/linux/trace_events.h
kernel/trace/trace.h
kernel/trace/trace_events_synth.c