linux-stable/tools
Raul Silvera 37ed2cddcb perf inject: Adjust output data offset for backward compatibility
When 'perf inject' creates a new file, it reuses the data offset from
the input file. If there has been a change on the size of the header, as
happened in v5.12 -> v5.13, the new offsets will be wrong, resulting in
a corrupted output file.

This change adds the function perf_session__data_offset to compute the
data offset based on the current header size, and uses that instead of
the offset from the original input file.

Signed-off-by: Raul Silvera <rsilvera@google.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Colin Ian King <colin.king@intel.com>
Cc: Dave Marchevsky <davemarchevsky@fb.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220621152725.2668041-1-rsilvera@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-06-26 12:32:55 -03:00
..
accounting delayacct: track delays from write-protect copy 2022-06-01 15:55:25 -07:00
arch tools headers cpufeatures: Sync with the kernel sources 2022-06-26 12:32:43 -03:00
bootconfig
bpf bpftool: Use sysfs vmlinux when dumping BTF by ID 2022-05-13 16:07:53 -07:00
build perf build: Stop using __weak bpf_map_create() to handle older libbpf versions 2022-05-26 12:36:56 -03:00
certs tools/certs: Add print-cert-tbs-hash.sh 2022-05-23 18:47:49 +03:00
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: Add new hardware clock type 2022-05-04 11:06:14 +02:00
hv
iio
include tools headers UAPI: Sync drm/i915_drm.h with the kernel sources 2022-06-26 12:32:43 -03:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-06-15 08:14:20 -04:00
laptop
leds
lib libperf evsel: Open shouldn't leak fd on failure 2022-06-19 10:41:43 -03:00
memory-model tools/memory-model/README: Update klitmus7 compat table 2022-05-03 10:12:48 -07:00
objtool x86/extable: Annotate ex_handler_msr_mce() as a dead end 2022-05-27 12:34:45 +02:00
pci
pcmcia
perf perf inject: Adjust output data offset for backward compatibility 2022-06-26 12:32:55 -03:00
power Power management updates for 5.19-rc1 2022-05-24 16:04:25 -07:00
rcu
scripts
spi
testing ARM64: 2022-06-24 12:17:47 -07:00
thermal tools/thermal: remove unneeded semicolon 2022-05-19 12:11:52 +02:00
time
tracing rtla: Remove procps-ng dependency 2022-05-26 15:20:46 -04:00
usb
virtio
vm mm/page-flags: reuse PG_mappedtodisk as PG_anon_exclusive for PageAnon() pages 2022-05-09 18:20:44 -07:00
wmi
Makefile Thermal control updates for 5.19-rc1 2022-05-24 16:19:30 -07:00