From: Feng Tang <feng.tang@intel.com>
To: Arnaldo Carvalho de Melo <acme@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Stephane Eranian <eranian@google.com>,
Andi Kleen <ak@linux.intel.com>, Feng Tang <feng.tang@intel.com>
Subject: [PATCH] perf, x86: Enabled PEBS event to be exported in a raw format
Date: Fri, 29 Jun 2012 00:00:50 +0800 [thread overview]
Message-ID: <1340899250-26803-1-git-send-email-feng.tang@intel.com> (raw)
From: Andi Kleen <ak@linux.intel.com>
Add support for reporting PEBS records in a raw format that can
be then parsed by perf script.
This is roughly similar to the existing AMD IBS support.
This is mainly for advanced users and to experiment with
new usages. Widespread PEBS usages are expected to get higher
level interfaces over time, like the existing "precise ip" support.
[Small fix of adding "data.raw = &raw;", thanks to Andi, with this
patch I can test my perf script with pebs samples. - Feng]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 026373e..04d3ba9 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -552,6 +552,7 @@ static void __intel_pmu_pebs_event(struct perf_event *event,
struct pebs_record_core *pebs = __pebs;
struct perf_sample_data data;
struct pt_regs regs;
+ struct perf_raw_record raw;
if (!intel_pmu_save_and_restart(event))
return;
@@ -578,6 +579,12 @@ static void __intel_pmu_pebs_event(struct perf_event *event,
else
regs.flags &= ~PERF_EFLAGS_EXACT;
+ if (event->attr.sample_type & PERF_SAMPLE_RAW) {
+ raw.size = x86_pmu.pebs_record_size;
+ raw.data = __pebs;
+ data.raw = &raw;
+ }
+
if (has_branch_stack(event))
data.br_stack = &cpuc->lbr_stack;
--
1.7.1
next reply other threads:[~2012-06-28 16:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-28 16:00 Feng Tang [this message]
2012-06-28 16:12 ` Peter Zijlstra
2012-06-28 16:15 ` Stephane Eranian
2012-06-28 16:19 ` Peter Zijlstra
2012-06-28 16:27 ` Stephane Eranian
2012-06-28 16:29 ` Peter Zijlstra
2012-06-28 18:26 ` Andi Kleen
2012-06-28 18:20 ` Andi Kleen
2012-06-28 20:51 ` Peter Zijlstra
2012-06-29 1:32 ` Feng Tang
2012-06-29 3:35 ` Andi Kleen
2012-06-29 12:49 ` Ingo Molnar
2012-07-03 7:36 ` Michael Ellerman
2012-07-03 9:15 ` Peter Zijlstra
2012-07-04 8:07 ` Michael Ellerman
2012-07-04 9:13 ` Peter Zijlstra
2012-07-05 15:57 ` Stephane Eranian
2012-07-07 7:27 ` Michael Ellerman
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=1340899250-26803-1-git-send-email-feng.tang@intel.com \
--to=feng.tang@intel.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®