aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/prog_array_init.c
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <[email protected]>2023-09-08 20:39:29 +0000
committerSteven Rostedt (Google) <[email protected]>2023-09-11 22:22:00 +0000
commitfc52a64416b010c8324e2cb50070faae868521c1 (patch)
tree2e20465d3523ecf12d49598b025e71311637180d /tools/testing/selftests/bpf/prog_tests/prog_array_init.c
parentselftests/ftrace: Fix dependencies for some of the synthetic event tests (diff)
downloadkernel-fc52a64416b010c8324e2cb50070faae868521c1.tar.gz
kernel-fc52a64416b010c8324e2cb50070faae868521c1.zip
tracing/synthetic: Fix order of struct trace_dynamic_info
To make handling BIG and LITTLE endian better the offset/len of dynamic fields of the synthetic events was changed into a structure of: struct trace_dynamic_info { #ifdef CONFIG_CPU_BIG_ENDIAN u16 offset; u16 len; #else u16 len; u16 offset; #endif }; to replace the manual changes of: data_offset = offset & 0xffff; data_offest = len << 16; But if you look closely, the above is: <len> << 16 | offset Which in little endian would be in memory: offset_lo offset_hi len_lo len_hi and in big endian: len_hi len_lo offset_hi offset_lo Which if broken into a structure would be: struct trace_dynamic_info { #ifdef CONFIG_CPU_BIG_ENDIAN u16 len; u16 offset; #else u16 offset; u16 len; #endif }; Which is the opposite of what was defined. Fix this and just to be safe also add "__packed". Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: [email protected] Cc: Mark Rutland <[email protected]> Tested-by: Sven Schnelle <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Fixes: ddeea494a16f3 ("tracing/synthetic: Use union instead of casts") Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions