public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman•id.au>
To: Sukadev Bhattiprolu <sukadev@linux•vnet.ibm.com>
Cc: Andi Kleen <ak@linux•intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello•nl>,
	robert.richter@amd•com, Anton Blanchard <anton@au1•ibm.com>,
	linux-kernel@vger•kernel.org,
	Stephane Eranian <eranian@google•com>,
	linuxppc-dev@ozlabs•org, Ingo Molnar <mingo@redhat•com>,
	Paul Mackerras <paulus@samba•org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols•net>,
	Jiri Olsa <jolsa@redhat•com>
Subject: Re: [PATCH 1/6][v3] perf/Power7: Use macros to identify perf events
Date: Wed, 23 Jan 2013 14:50:38 +1100	[thread overview]
Message-ID: <1358913038.29791.26.camel@concordia> (raw)
In-Reply-To: <20130110010347.GA32590@us.ibm.com>

On Wed, 2013-01-09 at 17:03 -0800, Sukadev Bhattiprolu wrote:
> [PATCH 1/6][v3] perf/Power7: Use macros to identify perf events
> 
> Define and use macros to identify perf events codes. This would make it
> easier and more readable when these event codes need to be used in more
> than one place.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux•vnet.ibm.com>
> ---
>  arch/powerpc/perf/power7-pmu.c |   28 ++++++++++++++++++++--------
>  1 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
> index 441af08..44e70d2 100644
> --- a/arch/powerpc/perf/power7-pmu.c
> +++ b/arch/powerpc/perf/power7-pmu.c
> @@ -51,6 +51,18 @@
>  #define MMCR1_PMCSEL_MSK	0xff
>  
>  /*
> + * Power7 event codes.
> + */
> +#define	PME_PM_CYC			0x1e
> +#define	PME_PM_GCT_NOSLOT_CYC		0x100f8
> +#define	PME_PM_CMPLU_STALL		0x4000a
> +#define	PME_PM_INST_CMPL		0x2
> +#define	PME_PM_LD_REF_L1		0xc880
> +#define	PME_PM_LD_MISS_L1		0x400f0
> +#define	PME_PM_BRU_FIN			0x10068
> +#define	PME_PM_BRU_MPRED		0x400f6
> +
> +/*
>   * Layout of constraint bits:
>   * 6666555555555544444444443333333333222222222211111111110000000000
>   * 3210987654321098765432109876543210987654321098765432109876543210
> @@ -296,14 +308,14 @@ static void power7_disable_pmc(unsigned int pmc, unsigned long mmcr[])
>  }
>  
>  static int power7_generic_events[] = {
> -	[PERF_COUNT_HW_CPU_CYCLES] = 0x1e,
> -	[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x100f8, /* GCT_NOSLOT_CYC */
> -	[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x4000a,  /* CMPLU_STALL */
> -	[PERF_COUNT_HW_INSTRUCTIONS] = 2,
> -	[PERF_COUNT_HW_CACHE_REFERENCES] = 0xc880,	/* LD_REF_L1_LSU*/
> -	[PERF_COUNT_HW_CACHE_MISSES] = 0x400f0,		/* LD_MISS_L1	*/
> -	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x10068,	/* BRU_FIN	*/
> -	[PERF_COUNT_HW_BRANCH_MISSES] = 0x400f6,	/* BR_MPRED	*/
> +	[PERF_COUNT_HW_CPU_CYCLES] =			PME_PM_CYC,
> +	[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] =	PME_PM_GCT_NOSLOT_CYC,
> +	[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] =	PME_PM_CMPLU_STALL,
> +	[PERF_COUNT_HW_INSTRUCTIONS] =			PME_PM_INST_CMPL,
> +	[PERF_COUNT_HW_CACHE_REFERENCES] =		PME_PM_LD_REF_L1,
> +	[PERF_COUNT_HW_CACHE_MISSES] =			PME_PM_LD_MISS_L1,


Your patch is good, but raises the question why we're using L1 events
for HW_CACHE.

AFAICS on Intel they use 0x42fe/0x412e, which are last-level-cache (LLC)
events.
        
        PMU name : ix86arch (Intel X86 architectural PMU)
        Name     : LLC_REFERENCES
        Desc     : count each request originating from the core to
        reference a cache line in the last level cache. The count may
        include speculation, but excludes cache line fills due to
        hardware prefetch
        Code     : 0x4f2e

        PMU name : ix86arch (Intel X86 architectural PMU)
        Name     : LLC_MISSES
        Desc     : count each cache miss condition for references to the
        last level cache. The event count may include speculation, but
        excludes cache line fills due to hardware prefetch
        Code     : 0x412e


That would seem to more closely match our PM_L3_LD_HIT/MISS?

cheers

  parent reply	other threads:[~2013-01-23  3:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10  1:03 [PATCH 1/6][v3] perf/Power7: Use macros to identify perf events Sukadev Bhattiprolu
2013-01-10  1:04 ` [PATCH 2/6][v3] perf: Make EVENT_ATTR global Sukadev Bhattiprolu
2013-01-10  1:05 ` [PATCH 3/6][v3] perf/POWER7: Make generic event translations available in sysfs Sukadev Bhattiprolu
2013-01-10  1:06 ` [PATCH 4/6][v3] perf/POWER7: Make some POWER7 events " Sukadev Bhattiprolu
2013-01-10  1:06 ` [PATCH 5/6][v3] perf: Create a sysfs entry for Power event format Sukadev Bhattiprolu
2013-01-10  1:07 ` [PATCH 6/6][v3] perf: Document the ABI of perf sysfs entries Sukadev Bhattiprolu
2013-01-15 18:57   ` Arnaldo Carvalho de Melo
2013-01-15 22:47     ` Greg KH
2013-01-16 11:30     ` Jiri Olsa
2013-01-16 18:58       ` Sukadev Bhattiprolu
2013-01-17 14:11         ` Jiri Olsa
2013-01-18 17:46           ` Sukadev Bhattiprolu
2013-01-18 19:20             ` Arnaldo Carvalho de Melo
2013-01-22 17:10             ` Jiri Olsa
2013-01-23  3:50 ` Michael Ellerman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-10  0:20 [PATCH 1/6][v3] perf/Power7: Use macros to identify perf events sukadev
2013-01-10  0:06 sukadev

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=1358913038.29791.26.camel@concordia \
    --to=michael@ellerman$(echo .)id.au \
    --cc=a.p.zijlstra@chello$(echo .)nl \
    --cc=acme@ghostprotocols$(echo .)net \
    --cc=ak@linux$(echo .)intel.com \
    --cc=anton@au1$(echo .)ibm.com \
    --cc=eranian@google$(echo .)com \
    --cc=jolsa@redhat$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=mingo@redhat$(echo .)com \
    --cc=paulus@samba$(echo .)org \
    --cc=robert.richter@amd$(echo .)com \
    --cc=sukadev@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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