linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: kan.liang@intel.com, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, x86: Fix :pp without LBR
Date: Fri, 8 Aug 2014 09:04:13 +0200	[thread overview]
Message-ID: <20140808070413.GC3935@laptop> (raw)
In-Reply-To: <1407456534-15747-1-git-send-email-andi@firstfloor.org>

On Thu, Aug 07, 2014 at 05:08:54PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> This fixes a side effect of Kan's earlier patch to probe the LBRs at boot
> time. Normally when the LBRs are disabled cycles:pp is disabled too.
> So for example cycles:pp doesn't work.
> 
> However this is not needed with PEBSv2 and later (Haswell) because
> it does not need LBRs to correct the IP-off-by-one.
> 
> So add an extra check for PEBSv2 that also allows :pp
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  arch/x86/kernel/cpu/perf_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
> index 2879ecd..0646d3b 100644
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -387,7 +387,7 @@ int x86_pmu_hw_config(struct perf_event *event)
>  			precise++;
>  
>  			/* Support for IP fixup */
> -			if (x86_pmu.lbr_nr)
> +			if (x86_pmu.lbr_nr || x86_pmu.intel_cap.pebs_format >= 2)
>  				precise++;

Thanks

  reply	other threads:[~2014-08-08  7:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08  0:08 [PATCH] perf, x86: Fix :pp without LBR Andi Kleen
2014-08-08  7:04 ` Peter Zijlstra [this message]
2014-08-13  8:24 ` [tip:perf/core] perf/x86: " tip-bot for Andi Kleen

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=20140808070413.GC3935@laptop \
    --to=peterz@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).