Commit 85846b2
perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag
Currently, branch_sample_type !=0 is used to check whether a branch
stack setup is required. But it doesn't check the sample type,
unnecessary branch stack setup may be done for a counting event. E.g.,
perf record -e "{branch-instructions,branch-misses}:S" -j any
Also, the event only with the new PERF_SAMPLE_BRANCH_COUNTERS branch
sample type may not require a branch stack setup either.
Add a new flag NEEDS_BRANCH_STACK to indicate whether the event requires
a branch stack setup. Replace the needs_branch_stack() by checking the
new flag.
The counting event check is implemented here. The later patch will take
the new PERF_SAMPLE_BRANCH_COUNTERS into account.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20231025201626.3000228-2-kan.liang@linux.intel.com1 parent 571d91d commit 85846b2
2 files changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2527 | 2527 | | |
2528 | 2528 | | |
2529 | 2529 | | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
2530 | 2535 | | |
2531 | 2536 | | |
2532 | | - | |
| 2537 | + | |
2533 | 2538 | | |
2534 | 2539 | | |
2535 | 2540 | | |
| |||
2820 | 2825 | | |
2821 | 2826 | | |
2822 | 2827 | | |
2823 | | - | |
| 2828 | + | |
2824 | 2829 | | |
2825 | 2830 | | |
2826 | 2831 | | |
| |||
3897 | 3902 | | |
3898 | 3903 | | |
3899 | 3904 | | |
3900 | | - | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
3901 | 3909 | | |
3902 | 3910 | | |
3903 | 3911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
0 commit comments