perf test: Fix unaligned access in sample parsing test
Namhyung Kim authored
[ Upstream commit c5c97cad ]

The ubsan reported the following error.  It was because sample's raw
data missed u32 padding at the end.  So it broke the alignment of the
array after it.

The raw data contains an u32 size prefix so the data size should have
an u32 padding after 8-byte aligned data.

27: Sample parsing  :util/synthetic-events.c:1539:4:
  runtime error: store to misaligned address 0x62100006b9bc for type
  '__u64' (aka 'unsigned long long'), which requires 8 byte alignment
0x62100006b9bc: note: pointer points here
  00 00 00 00 ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
              ^
    #0 0x561532a9fc96 in perf_event__synthesize_sample util/synthetic-events.c:1539:13
    #1 0x5615327f4a4f in do_test tests/sample-parsing.c:284:8
    #2 0x5615327f3f50 in test__sample_parsing tests/sample-parsing.c:381:9
    #3 0x56153279d3a1 in run_test tests/builtin-test.c:424:...
25e20129
Name Last commit Last update
..
arch perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks
build Kbuild: fix # escaping in .cmd files for future Make
cgroup cgroups: fix cgroup_event_listener error handling
firewire tools/firewire: nosy-dump: check for allocation failure
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning
iio iio: iio-utils: Fix possible incorrect mask calculation
include tools include: Adopt linux/bits.h
laptop/freefall Move freefall program from Documentation/ to tools/
lguest tools/lguest: Clean up include dir
lib tools lib traceevent: Fix memory leak in process_dynamic_array_len
net tools/net: Use include/uapi with __EXPORTED_HEADERS__
nfsd NFSD: Added fault injection script
perf perf test: Fix unaligned access in sample parsing test
power cpupower: avoid multiple definition with gcc -fno-common
scripts tools: Let O= makes handle a relative path with -C option
testing selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
thermal/tmon tools/thermal: tmon: fix for segfault
time tools: add script to test udelay
usb usbip: Fix unsafe unaligned pointer usage
virtio tools/virtio: fix byteswap logic
vm tools/vm/page-types.c: fix "defined but not used" warning
Makefile tools: Add a "make all" rule