From: Kan Liang <kan.liang@intel.com>
To: peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
linux-kernel@vger.kernel.org
Cc: eranian@google.com, andi@firstfloor.org, Kan Liang <kan.liang@intel.com>
Subject: [PATCH V2 2/3] perf/x86/intel/uncore: handle non-standard counter offset
Date: Tue, 16 Aug 2016 16:09:49 -0400 [thread overview]
Message-ID: <1471378190-17276-2-git-send-email-kan.liang@intel.com> (raw)
In-Reply-To: <1471378190-17276-1-git-send-email-kan.liang@intel.com>
From: Stephane Eranian <eranian@google.com>
The offset of the counters for UPI and M2M boxes on Skylake server is
non-standard (8 bytes apart).
This patch introduces a custom flag UNCORE_BOX_FLAG_CTL_OFFS8 to
specially handle it.
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
No Change since V1
arch/x86/events/intel/uncore.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index 78b9c23..a43175f 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -120,6 +120,7 @@ struct intel_uncore_box {
};
#define UNCORE_BOX_FLAG_INITIATED 0
+#define UNCORE_BOX_FLAG_CTL_OFFS8 1 /* event config registers are 8-byte apart */
struct uncore_event_desc {
struct kobj_attribute attr;
@@ -172,6 +173,9 @@ static inline unsigned uncore_pci_fixed_ctr(struct intel_uncore_box *box)
static inline
unsigned uncore_pci_event_ctl(struct intel_uncore_box *box, int idx)
{
+ if (test_bit(UNCORE_BOX_FLAG_CTL_OFFS8, &box->flags))
+ return idx * 8 + box->pmu->type->event_ctl;
+
return idx * 4 + box->pmu->type->event_ctl;
}
--
2.5.5
next prev parent reply other threads:[~2016-08-16 20:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 20:09 [PATCH V2 1/3] perf/x86/intel/uncore: remove hard code for Node ID mapping location Kan Liang
2016-08-16 20:09 ` Kan Liang [this message]
2016-09-05 11:52 ` [tip:perf/core] perf/x86/intel/uncore: Handle non-standard counter offset tip-bot for Stephane Eranian
2016-08-16 20:09 ` [PATCH V2 3/3] perf/x86/intel/uncore: Add Skylake server uncore support Kan Liang
2016-09-10 12:42 ` [tip:perf/core] " tip-bot for Kan Liang
2016-09-05 11:52 ` [tip:perf/core] perf/x86/intel/uncore: Remove hard-coded implementation for Node ID mapping location tip-bot for Kan Liang
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=1471378190-17276-2-git-send-email-kan.liang@intel.com \
--to=kan.liang@intel.com \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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