Re: [PATCH V6 06/13] perf: Add Nehalem and Sandy Bridge uncore support

From: Stephane Eranian
Date: Mon Jun 18 2012 - 05:23:26 EST


On Sat, Jun 16, 2012 at 2:46 PM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
>
> On Fri, 2012-06-15 at 20:46 +0200, Stephane Eranian wrote:
> > Yes, and let the parser be case insensitive.
>
> Right, I did the below on top..
>
> ---
> --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> @@ -179,22 +179,17 @@ static struct attribute *snbep_uncore_pc
> Â};
>
> Âstatic struct uncore_event_desc snbep_uncore_imc_events[] = {
> - Â Â Â INTEL_UNCORE_EVENT_DESC(CLOCKTICKS, "config=0xffff"),
> - Â Â Â /* read */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(CAS_COUNT_RD, "event=0x4,umask=0x3"),
> - Â Â Â /* write */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(CAS_COUNT_WR, "event=0x4,umask=0xc"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â"event=0xff,umask=0xff");

Just like for core, I would pick 0xff as the pseudo event code for
fixed uncore events
and use the umask value to determine which of the fixed events we want
to map to. There
is only one fixed counter so far. But more could be added later on, so
why not start with
umask=0x00 or umask=0x1 instead of umask=0xff?

> + Â Â Â INTEL_UNCORE_EVENT_DESC(cas_count_read, Â"event=0x04,umask=0x03"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(cas_count_write, "event=0x04,umask=0x0c"),
> Â Â Â Â{ /* end: all zeroes */ },
> Â};
>
> Âstatic struct uncore_event_desc snbep_uncore_qpi_events[] = {
> - Â Â Â INTEL_UNCORE_EVENT_DESC(CLOCKTICKS, "event=0x14"),
> - Â Â Â /* outgoing data+nondata flits */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(TxL_FLITS_ACTIVE, "event=0x0,umask=0x6"),
> - Â Â Â /* DRS data received */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(DRS_DATA, "event=0x2,umask=0x8"),
> - Â Â Â /* NCB data received */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(NCB_DATA, "event=0x3,umask=0x4"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â "event=0x14"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(txl_flits_active, "event=0x0,umask=0x6"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(drs_data, Â Â Â Â "event=0x2,umask=0x8"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(ncb_data, Â Â Â Â "event=0x3,umask=0x4"),
> Â Â Â Â{ /* end: all zeroes */ },
> Â};
>
> @@ -621,29 +616,15 @@ static struct attribute_group nhm_uncore
> Â};
>
> Âstatic struct uncore_event_desc nhm_uncore_events[] = {
> - Â Â Â INTEL_UNCORE_EVENT_DESC(CLOCKTICKS, "config=0xffff"),
> - Â Â Â /* full cache line writes to DRAM */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QMC_WRITES_FULL_ANY,
> "event=0x2f,umask=0xf"),
> - Â Â Â /* Quickpath Memory Controller normal priority read requests */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QMC_NORMAL_READS_ANY,
> "event=0x2c,umask=0xf"),
> - Â Â Â /* Quickpath Home Logic read requests from the IOH */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_IOH_READS,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x1"),
> - Â Â Â /* Quickpath Home Logic write requests from the IOH */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_IOH_WRITES,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x2"),
> - Â Â Â /* Quickpath Home Logic read requests from a remote socket */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_REMOTE_READS,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x4"),
> - Â Â Â /* Quickpath Home Logic write requests from a remote socket */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_REMOTE_WRITES,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x8"),
> - Â Â Â /* Quickpath Home Logic read requests from the local socket */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_LOCAL_READS,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x10"),
> - Â Â Â /* Quickpath Home Logic write requests from the local socket */
> - Â Â Â INTEL_UNCORE_EVENT_DESC(QHL_REQUEST_LOCAL_WRITES,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "event=0x20,umask=0x20"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks,
> Â"event=0xff,umask=0xff"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qmc_writes_full_any,
> "event=0x2f,umask=0x0f"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qmc_normal_reads_any,
> Â"event=0x2c,umask=0x0f"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_ioh_reads,
> "event=0x20,umask=0x01"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_ioh_writes,
> Â"event=0x20,umask=0x02"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_remote_reads,
> Â"event=0x20,umask=0x04"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_remote_writes,
> "event=0x20,umask=0x08"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_local_reads,
> "event=0x20,umask=0x10"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(qhl_request_local_writes,
> Â"event=0x20,umask=0x20"),
> Â Â Â Â{ /* end: all zeroes */ },
> Â};
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/