diff options
author | Namhyung Kim <namhyung@kernel.org> | 2023-01-18 07:05:58 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-01-18 11:57:20 +0100 |
commit | f6e707156e1d5d150f288823987bee1ba0104c4c (patch) | |
tree | 079e268b0e399f382cc1ad3221ed0bd1266d75b6 /arch/x86/events | |
parent | perf/core: Do not pass header for sample ID init (diff) | |
download | linux-f6e707156e1d5d150f288823987bee1ba0104c4c.tar.xz linux-f6e707156e1d5d150f288823987bee1ba0104c4c.zip |
perf/core: Introduce perf_prepare_header()
Factor out perf_prepare_header() so that it can call
perf_prepare_sample() without a header if not needed.
Also it checks the filtered_sample_type to avoid duplicate
work when perf_prepare_sample() is called twice (or more).
Suggested-by: Peter Zijlstr <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-8-namhyung@kernel.org
Diffstat (limited to 'arch/x86/events')
-rw-r--r-- | arch/x86/events/intel/ds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 07c8a2cdc3ee..183efa914b99 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -807,7 +807,8 @@ int intel_pmu_drain_bts_buffer(void) * the sample. */ rcu_read_lock(); - perf_prepare_sample(&header, &data, event, ®s); + perf_prepare_sample(&data, event, ®s); + perf_prepare_header(&header, &data, event, ®s); if (perf_output_begin(&handle, &data, event, header.size * (top - base - skip))) |