From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, jolsa@redhat.com, mingo@elte.hu,
irogers@google.com, namhyung@kernel.org
Subject: Re: [PATCH] perf/x86/intel: make anythread filter support conditional
Date: Thu, 22 Oct 2020 10:00:03 +0200 [thread overview]
Message-ID: <20201022080003.GR2628@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201021211612.2026234-1-eranian@google.com>
On Wed, Oct 21, 2020 at 02:16:12PM -0700, Stephane Eranian wrote:
> Starting with Arch Perfmon v5, the anythread filter on generic counters may be
> deprecated. The current kernel was exporting the any filter without checking.
> On Icelake, it means you could do cpu/event=0x3c,any/ even though the filter
> does not exist. This patch corrects the problem by relying on the CPUID 0xa leaf
> function to determine if anythread is supported or not as described in the
> Intel SDM Vol3b 18.2.5.1 AnyThread Deprecation section.
>
> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---
> arch/x86/events/intel/core.c | 20 ++++++++++++++++++++
> arch/x86/events/perf_event.h | 1 +
> arch/x86/include/asm/perf_event.h | 4 +++-
> arch/x86/kvm/cpuid.c | 4 +++-
> 4 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
> index f1926e9f2143..65bf649048a6 100644
> --- a/arch/x86/events/intel/core.c
> +++ b/arch/x86/events/intel/core.c
> @@ -4220,6 +4220,16 @@ static struct attribute *intel_arch3_formats_attr[] = {
> NULL,
> };
>
> +static struct attribute *intel_arch5_formats_attr[] = {
> + &format_attr_event.attr,
> + &format_attr_umask.attr,
> + &format_attr_edge.attr,
> + &format_attr_pc.attr,
> + &format_attr_inv.attr,
> + &format_attr_cmask.attr,
> + NULL,
> +};
Instead of adding yet another (which is an exact duplicate of the
existing intel_arch_formats_attr BTW), can't we clean this up and use
is_visible() as 'demanded' by GregKH and done by Jiri here:
3d5672735b23 ("perf/x86: Add is_visible attribute_group callback for base events")
b7c9b3927337 ("perf/x86/intel: Use ->is_visible callback for default group")
baa0c83363c7 ("perf/x86: Use the new pmu::update_attrs attribute group")
And only have "any" visible for v3,v4
next prev parent reply other threads:[~2020-10-22 8:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 21:16 Stephane Eranian
2020-10-21 22:39 ` Andi Kleen
2020-10-22 8:00 ` Peter Zijlstra [this message]
2020-10-22 17:24 ` Stephane Eranian
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=20201022080003.GR2628@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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
Powered by JetHome