]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf/x86: Add dynamic constraint
authorKan Liang <kan.liang@linux.intel.com>
Thu, 27 Mar 2025 19:52:13 +0000 (12:52 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 8 Apr 2025 18:55:48 +0000 (20:55 +0200)
commit4dfe3232cc04325a09e96f6c7f9546ba6c0b132b
tree04cc85bdf898a6963a1df1dc6484c4a867a3a302
parentda916e96e2dedcb2d40de77a7def833d315b81a6
perf/x86: Add dynamic constraint

More and more features require a dynamic event constraint, e.g., branch
counter logging, auto counter reload, Arch PEBS, etc.

Add a generic flag, PMU_FL_DYN_CONSTRAINT, to indicate the case. It
avoids keeping adding the individual flag in intel_cpuc_prepare().

Add a variable dyn_constraint in the struct hw_perf_event to track the
dynamic constraint of the event. Apply it if it's updated.

Apply the generic dynamic constraint for branch counter logging.
Many features on and after V6 require dynamic constraint. So
unconditionally set the flag for V6+.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Link: https://lkml.kernel.org/r/20250327195217.2683619-2-kan.liang@linux.intel.com
arch/x86/events/core.c
arch/x86/events/intel/core.c
arch/x86/events/intel/lbr.c
arch/x86/events/perf_event.h
include/linux/perf_event.h