Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Liang, Kan
On 4/8/2021 9:40 AM, Peter Zijlstra wrote: @@ -4330,7 +4347,7 @@ static int intel_pmu_check_period(struct perf_event *event, u64 value) static int intel_pmu_aux_output_match(struct perf_event *event) { - if (!x86_pmu.intel_cap.pebs_output_pt_available) + if

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Liang, Kan
On 4/8/2021 1:00 PM, Peter Zijlstra wrote: On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: +#define is_hybrid()(!!x86_pmu.num_hybrid_pmus) Given this is sprinkled all over the place, can you make this a static_key_false +

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > +#define is_hybrid() (!!x86_pmu.num_hybrid_pmus) Given this is sprinkled all over the place, can you make this a static_key_false + static_branch_unlikely() such that the hybrid case is out-of-line?

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > +static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) > +{ > + union perf_capabilities *intel_cap; > + > + intel_cap = is_hybrid() ? _pmu(event->pmu)->intel_cap : > +

Re: [PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 03:40:56PM +0200, Peter Zijlstra wrote: > On Mon, Apr 05, 2021 at 08:10:46AM -0700, kan.li...@linux.intel.com wrote: > > +static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) > > +{ > > + union perf_capabilities *intel_cap; > > + > > + intel_cap =

[PATCH V5 04/25] perf/x86/intel: Hybrid PMU support for perf capabilities

2021-04-05 Thread kan . liang
From: Kan Liang Some platforms, e.g. Alder Lake, have hybrid architecture. Although most PMU capabilities are the same, there are still some unique PMU capabilities for different hybrid PMUs. Perf should register a dedicated pmu for each hybrid PMU. Add a new struct x86_hybrid_pmu, which saves