From: Peter Zijlstra <peterz@infradead.org>
To: kan.liang@linux.intel.com
Cc: mingo@kernel.org, acme@kernel.org, namhyung@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
ak@linux.intel.com, eranian@google.com
Subject: Re: [PATCH V3 01/13] perf/x86/intel: Support the PEBS event mask
Date: Fri, 28 Jun 2024 10:42:48 +0200 [thread overview]
Message-ID: <20240628084248.GE31592@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20240626143545.480761-2-kan.liang@linux.intel.com>
On Wed, Jun 26, 2024 at 07:35:33AM -0700, kan.liang@linux.intel.com wrote:
> @@ -1661,6 +1661,16 @@ static inline int is_ht_workaround_enabled(void)
> return !!(x86_pmu.flags & PMU_FL_EXCL_ENABLED);
> }
>
> +static inline u64 intel_pmu_pebs_mask(u64 cntr_mask)
> +{
> + return MAX_PEBS_EVENTS_MASK & cntr_mask;
> +}
> +
> +static inline int intel_pmu_max_num_pebs(struct pmu *pmu)
> +{
> + return find_last_bit((unsigned long *)&hybrid(pmu, pebs_events_mask), MAX_PEBS_EVENTS) + 1;
I'll write that like:
static_assert(MAX_PEBS_EVENTS == 32);
return fls((u32)hybrid(pmu, pebs_events_mask));
> +}
> +
> #else /* CONFIG_CPU_SUP_INTEL */
>
> static inline void reserve_ds_buffers(void)
> diff --git a/arch/x86/include/asm/intel_ds.h b/arch/x86/include/asm/intel_ds.h
> index 2f9eeb5c3069..5dbeac48a5b9 100644
> --- a/arch/x86/include/asm/intel_ds.h
> +++ b/arch/x86/include/asm/intel_ds.h
> @@ -9,6 +9,7 @@
> /* The maximal number of PEBS events: */
> #define MAX_PEBS_EVENTS_FMT4 8
> #define MAX_PEBS_EVENTS 32
> +#define MAX_PEBS_EVENTS_MASK GENMASK_ULL(MAX_PEBS_EVENTS - 1, 0)
> #define MAX_FIXED_PEBS_EVENTS 16
>
> /*
> --
> 2.38.1
>
next prev parent reply other threads:[~2024-06-28 8:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 14:35 [PATCH V3 00/13] Support Lunar Lake and Arrow Lake core PMU kan.liang
2024-06-26 14:35 ` [PATCH V3 01/13] perf/x86/intel: Support the PEBS event mask kan.liang
2024-06-28 8:42 ` Peter Zijlstra [this message]
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 02/13] perf/x86: Support counter mask kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 03/13] perf/x86: Add Lunar Lake and Arrow Lake support kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 04/13] perf/x86/intel: Rename model-specific pebs_latency_data functions kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 05/13] perf/x86/intel: Support new data source for Lunar Lake kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 06/13] perf/x86: Add config_mask to represent EVENTSEL bitmask kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 07/13] perf/x86/intel: Support PERFEVTSEL extension kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 08/13] perf/x86/intel: Support Perfmon MSRs aliasing kan.liang
2024-07-05 21:06 ` [tip: perf/core] " tip-bot2 for Kan Liang
2024-06-26 14:35 ` [PATCH V3 09/13] perf/x86: Extend event update interface kan.liang
2024-06-26 14:35 ` [PATCH V3 10/13] perf: Extend perf_output_read kan.liang
2024-06-26 14:35 ` [PATCH V3 11/13] perf/x86/intel: Move PEBS event update after the sample output kan.liang
2024-06-26 14:35 ` [PATCH V3 12/13] perf/x86/intel: Support PEBS counters snapshotting kan.liang
2024-06-26 14:35 ` [PATCH V3 13/13] perf/x86/intel: Support RDPMC metrics clear mode kan.liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240628084248.GE31592@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox