perf: Consolidate branch sample filter helpers
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 6 Sep 2022 08:44:14 +0000 (14:14 +0530)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 7 Sep 2022 19:54:00 +0000 (21:54 +0200)
commit03b02db93be407103c385814033633364674a6f6
treef2811ca21b2318a22656dd771c90a70f7336cd00
parentee9db0e14b0575aa827579dc2471a29ec5fc6877
perf: Consolidate branch sample filter helpers

Besides the branch type filtering requests, 'event.attr.branch_sample_type'
also contains various flags indicating which additional information should
be captured, along with the base branch record. These flags help configure
the underlying hardware, and capture the branch records appropriately when
required e.g after PMU interrupt. But first, this moves an existing helper
perf_sample_save_hw_index() into the header before adding some more helpers
for other branch sample filter flags.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220906084414.396220-1-anshuman.khandual@arm.com
include/linux/perf_event.h
kernel/events/core.c