All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf, x86: Enabled PEBS event to be exported in a raw format
@ 2012-06-28 16:00 Feng Tang
  2012-06-28 16:12 ` Peter Zijlstra
  2012-07-03  7:36 ` Michael Ellerman
  0 siblings, 2 replies; 18+ messages in thread
From: Feng Tang @ 2012-06-28 16:00 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, linux-kernel
  Cc: x86, Stephane Eranian, Andi Kleen, Feng Tang

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


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-07-07  7:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28 16:00 [PATCH] perf, x86: Enabled PEBS event to be exported in a raw format Feng Tang
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.