All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Leo Yan <leo.yan@linaro.org>,
	Kan Liang <kan.liang@linux.intel.com>,
	x86@kernel.org, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 1/3] perf/x86: Add new event for AUX output counter index
Date: Mon, 5 Jul 2021 09:24:00 +0200	[thread overview]
Message-ID: <YOKzkPQ5gAeLUTnY@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210701131732.31602-2-adrian.hunter@intel.com>

On Thu, Jul 01, 2021 at 04:17:30PM +0300, Adrian Hunter wrote:
> diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
> index e28892270c58..7a7c3b18acec 100644
> --- a/arch/x86/events/intel/core.c
> +++ b/arch/x86/events/intel/core.c
> @@ -2400,6 +2400,12 @@ static void intel_pmu_disable_event(struct perf_event *event)
>  		intel_pmu_pebs_disable(event);
>  }
>  
> +static void intel_pmu_assign_event(struct perf_event *event, int idx)
> +{
> +	if (is_pebs_pt(event))
> +		perf_report_aux_output_id(event, idx);
> +}
> +
>  static void intel_pmu_del_event(struct perf_event *event)
>  {
>  	if (needs_branch_stack(event))
> @@ -4596,6 +4602,7 @@ static __initconst const struct x86_pmu intel_pmu = {
>  	.enable_all		= intel_pmu_enable_all,
>  	.enable			= intel_pmu_enable_event,
>  	.disable		= intel_pmu_disable_event,
> +	.assign			= intel_pmu_assign_event,
>  	.add			= intel_pmu_add_event,
>  	.del			= intel_pmu_del_event,
>  	.read			= intel_pmu_read_event,

How about we only set that method (or clear it again) when
intel_cap.pebs_output_pt_available ?

Other than that, this looks good to me.

  reply	other threads:[~2021-07-05  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 13:17 [PATCH V2 0/3] perf intel-pt: Add PEBS-via-PT side-band Adrian Hunter
2021-07-01 13:17 ` [PATCH V2 1/3] perf/x86: Add new event for AUX output counter index Adrian Hunter
2021-07-05  7:24   ` Peter Zijlstra [this message]
2021-08-13 12:17     ` Adrian Hunter
2021-07-01 13:17 ` [PATCH V2 2/3] perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID Adrian Hunter
2021-07-01 13:17 ` [PATCH V2 3/3] perf intel-pt: " Adrian Hunter

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=YOKzkPQ5gAeLUTnY@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.