Re: [PATCH 1/2] perf/x86: Use 0xff as pseudo code for fixed uncore event

From: Stephane Eranian
Date: Wed Jun 27 2012 - 09:06:52 EST


On Wed, Jun 27, 2012 at 9:09 AM, Yan, Zheng <zheng.z.yan@xxxxxxxxx> wrote:
> From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>
>
> Stephane Eranian suggestted using 0xff as pseudo code for fixed
> uncore event and using the umask value to determine which of the
> fixed events we want to map to. So far there is at most one fixed
> counter in a uncore PMU. So just change the definition of
> UNCORE_FIXED_EVENT to 0xff.
>
I would still do: event=0xff,umask=0x00
to reinforce the fact that first fixed counter is index 0x00.

> Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
> ---
> Âarch/x86/kernel/cpu/perf_event_intel_uncore.c | Â Â4 ++--
> Âarch/x86/kernel/cpu/perf_event_intel_uncore.h | Â Â2 +-
> Â2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> index 6f43f95..8ca0f8f 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> @@ -179,7 +179,7 @@ static struct attribute *snbep_uncore_pcu_formats_attr[] = {
> Â};
>
> Âstatic struct uncore_event_desc snbep_uncore_imc_events[] = {
> - Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â"event=0xff,umask=0xff"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â"event=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 */ },
> @@ -616,7 +616,7 @@ static struct attribute_group nhm_uncore_format_group = {
> Â};
>
> Âstatic struct uncore_event_desc nhm_uncore_events[] = {
> - Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â Â Â Â Â Â"event=0xff,umask=0xff"),
> + Â Â Â INTEL_UNCORE_EVENT_DESC(clockticks, Â Â Â Â Â Â Â Â"event=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"),
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
> index 4d52db0..88498c7 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h
> +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h
> @@ -9,7 +9,7 @@
>
> Â#define UNCORE_PMU_HRTIMER_INTERVAL Â Â(60 * NSEC_PER_SEC)
>
> -#define UNCORE_FIXED_EVENT Â Â Â Â Â Â 0xffff
> +#define UNCORE_FIXED_EVENT Â Â Â Â Â Â 0xff
> Â#define UNCORE_PMC_IDX_MAX_GENERIC Â Â 8
> Â#define UNCORE_PMC_IDX_FIXED Â Â Â Â Â UNCORE_PMC_IDX_MAX_GENERIC
> Â#define UNCORE_PMC_IDX_MAX Â Â Â Â Â Â (UNCORE_PMC_IDX_FIXED + 1)
> --
> 1.7.10.2
>
--
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/