diff options
author | Namhyung Kim <namhyung@kernel.org> | 2023-01-18 07:05:53 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-01-18 11:57:19 +0100 |
commit | 31046500c1864b8ab25d1b9846ad10aa3f7b1821 (patch) | |
tree | b5c0d120afc30522f65f58adec7ce526c7d0af77 /arch/x86/events/amd | |
parent | perf/core: Save the dynamic parts of sample data size (diff) | |
download | linux-31046500c1864b8ab25d1b9846ad10aa3f7b1821.tar.xz linux-31046500c1864b8ab25d1b9846ad10aa3f7b1821.zip |
perf/core: Add perf_sample_save_callchain() helper
When we save the callchain to the perf sample data, we need to update
the sample flags and the dynamic size. To ensure this is done consistently,
add the perf_sample_save_callchain() helper and convert all call sites.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230118060559.615653-3-namhyung@kernel.org
Diffstat (limited to 'arch/x86/events/amd')
-rw-r--r-- | arch/x86/events/amd/ibs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index da3f5ebac4e1..417c80bd3274 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -1122,10 +1122,8 @@ fail: * recorded as part of interrupt regs. Thus we need to use rip from * interrupt regs while unwinding call stack. */ - if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN) { - data.callchain = perf_callchain(event, iregs); - data.sample_flags |= PERF_SAMPLE_CALLCHAIN; - } + if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN) + perf_sample_save_callchain(&data, event, iregs); throttle = perf_event_overflow(event, &data, ®s); out: |