tracing: Fix endianness bug in histogram trigger
authorSven Schnelle <svens@linux.ibm.com>
Wed, 18 Dec 2019 07:44:27 +0000 (08:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:20:00 +0000 (10:20 +0100)
commit09f80e915f1421d9e04c4b691f0f2f3358d1c1e9
tree99b1e4fc6602ef9f7a7f02fa48f75e1aeed13c4d
parent038840ff78f4d9c9699cf2eb7f0798152b671a51
tracing: Fix endianness bug in histogram trigger

commit fe6e096a5bbf73a142f09c72e7aa2835026eb1a3 upstream.

At least on PA-RISC and s390 synthetic histogram triggers are failing
selftests because trace_event_raw_event_synth() always writes a 64 bit
values, but the reader expects a field->size sized value. On little endian
machines this doesn't hurt, but on big endian this makes the reader always
read zero values.

Link: http://lore.kernel.org/linux-trace-devel/20191218074427.96184-4-svens@linux.ibm.com
Cc: stable@vger.kernel.org
Fixes: 4b147936fa509 ("tracing: Add support for 'synthetic' events")
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_hist.c