diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2022-09-01 16:09:56 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-09-06 12:33:02 +0300 |
commit | a9a931e2666878343782c82d7d55cc173ddeb3e9 (patch) | |
tree | 1a5c971a8b8270afec0a4c05b7d6ea0e9072599a /arch/x86/events/core.c | |
parent | 47a3aeb39e8dc099ae431cd8b46bdf218f5511b2 (diff) | |
download | linux-a9a931e2666878343782c82d7d55cc173ddeb3e9.tar.xz |
perf: Use sample_flags for branch stack
Use the new sample_flags to indicate whether the branch stack is filled
by the PMU driver.
Remove the br_stack from the perf_sample_data_init() to minimize the number
of cache lines touched.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220901130959.1285717-4-kan.liang@linux.intel.com
Diffstat (limited to 'arch/x86/events/core.c')
-rw-r--r-- | arch/x86/events/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index f969410d0c90..bb34a28fa71b 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1714,8 +1714,10 @@ int x86_pmu_handle_irq(struct pt_regs *regs) perf_sample_data_init(&data, 0, event->hw.last_period); - if (has_branch_stack(event)) + if (has_branch_stack(event)) { data.br_stack = &cpuc->lbr_stack; + data.sample_flags |= PERF_SAMPLE_BRANCH_STACK; + } if (perf_event_overflow(event, &data, regs)) x86_pmu_stop(event, 0); |