[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d4bf9ac.cf03d90a.2908.2186@mx.google.com>
Date: Fri, 4 Feb 2011 14:00:01 +0200
From: Stephane Eranian <eranian@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: peterz@...radead.org, mingo@...e.hu, paulus@...ba.org,
davem@...emloft.net, fweisbec@...il.com,
perfmon2-devel@...ts.sf.net, eranian@...il.com, eranian@...gle.com,
robert.richter@....com, acme@...hat.com, gorcunov@...il.com,
ming.m.lin@...el.com
Subject: [PATCH 0/2] perf_events: add support for Intel fixed counter 2
This short series of patches adds support for Intel fixed counter 2
on processors which implement architectural perfmon v2 and later.
Fixed counter 2 is wired to count reference cycles. It corrresponds
to architected event UNHALTED_REFERENCE_CYCLES. This is a very useful
event because:
- it is imune to Turbo Mode on Intel Nehalem and follow-ons
- it is imune to frequency scaling, including during idle
In other words, it keeps a constant correlation to time. It is
therefore a good source a reliable timings comparable to TSC.
The other advantage of providing access to this counter is that
it offers an additional cycle-counting counter. This is useful
when the NMI watchdog is active because it already consumes one
such counter.
The difficulty in providing access to the counter (and event) is
that the encoding 0x013c is ambiguous. It also corresponds to event
CPU_CLK_UNHALTED:REF_P (or BUS) which is measured on generic counters.
The issue is that this event counts a different kind of cycles: bus cycles.
Thus, the event code 0x13c is not enough to differentiate what the user
wants.
This series of patches solves this problem by introducing a custom
encoding for UNHALTED_REFERENCE_CYCLES (0xff3c) and improving
the constraint infrastructure to handle events which can ONLY be
measured on fixed counters.
The UNHALTED_REFERENCE_CYCLES (and fixed counter 2) is available on
all Intel processors since architectural perfmon v2 (Intel Yonah).
[PATCH 0/2] - Introduction
[PATCH 1/2] - Improvement to X86 constraints management
[PATCH 0/2] - add fixed counter 2 support
Signed-off-by: Stephane Eranian <eranian@...gle.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists