From: Namhyung Kim <namhyung.kim@lge.com>
To: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Paul Mackerras <paulus@samba.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf, x86: Make cycles:p working on SNB
Date: Thu, 24 May 2012 17:59:44 +0900 [thread overview]
Message-ID: <87sjeqq7i7.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <CABPqkBRcz1a738M7g484B0p-dJrKqP6GSLE7gpPN0H1w-72oWw@mail.gmail.com> (Stephane Eranian's message of "Thu, 24 May 2012 09:41:45 +0200")
Hi, Stephane
On Thu, 24 May 2012 09:41:45 +0200, Stephane Eranian wrote:
> On Thu, May 24, 2012 at 9:27 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>> On Thu, 2012-05-24 at 12:02 +0900, Namhyung Kim wrote:
>>
>>> --- a/arch/x86/kernel/cpu/perf_event_intel.c
>>> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
>>> @@ -1329,6 +1329,12 @@ static int intel_pmu_hw_config(struct perf_event *event)
>>> */
>>> u64 alt_config = X86_CONFIG(.event=0xc0, .inv=1, .cmask=16);
>>>
>>> + /*
>>> + * SNB introduced INST_RETIRED.PREC_DIST for this purpose.
>>> + */
>>> + if (x86_pmu.pebs_constraints == intel_snb_pebs_event_constraints)
>>> + alt_config = X86_CONFIG(.event=0xc0, .umask=0x01,
>>> + .inv=1, .cmask=16);
>>>
>>> alt_config |= (event->hw.config & ~X86_RAW_EVENT_MASK);
>>> event->hw.config = alt_config;
>>
>> That's rather ugly.. but that's okay, I've actually got the patch for
>> this still laying around, it needs a bit of an update though.
>>
> You cannot simply use PREC_DIST. This umask has some severe
> restriction. When you measure it, NO other event on the the entire PMU
> can be measured at the same time. It needs exclusive mode on SNB.
>
Yeah, I read something like above on the SDM. But just got confused with
this:
$ ./perf stat -e cycles:p,instructions,cache-references,cache-misses noploop 1
Performance counter stats for 'noploop 1':
3,741,658,837 cycles # 0.000 GHz
3,618,983,116 instructions # 0.97 insns per cycle
51,126 cache-references
7,357 cache-misses # 14.390 % of all cache refs
1.000692634 seconds time elapsed
Thanks,
Namhyung
next prev parent reply other threads:[~2012-05-24 9:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 3:02 [PATCH] perf, x86: Make cycles:p working on SNB Namhyung Kim
2012-05-24 7:27 ` Peter Zijlstra
2012-05-24 7:41 ` Stephane Eranian
2012-05-24 7:52 ` Peter Zijlstra
2012-05-24 7:57 ` Peter Zijlstra
2012-05-24 8:00 ` Stephane Eranian
2012-05-24 8:07 ` Peter Zijlstra
2012-05-24 8:59 ` Stephane Eranian
2012-05-24 9:01 ` Namhyung Kim
2012-05-24 7:58 ` Stephane Eranian
2012-05-30 12:16 ` Peter Zijlstra
2012-06-01 7:44 ` Stephane Eranian
2012-05-24 8:59 ` Namhyung Kim [this message]
2012-05-24 9:06 ` Stephane Eranian
2012-05-24 8:53 ` Namhyung Kim
2012-05-24 8:59 ` 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=87sjeqq7i7.fsf@sejong.aot.lge.com \
--to=namhyung.kim@lge.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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