Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e1a40dd authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

perf, x86: Expose the full PEBS record using PERF_SAMPLE_RAW



Expose the full PEBS record using PERF_SAMPLE_RAW

Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: paulus@samba.org
Cc: eranian@google.com
Cc: robert.richter@amd.com
Cc: fweisbec@gmail.com
LKML-Reference: <20100304140100.847218224@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8db909a7
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -457,6 +457,7 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
	struct perf_event *event = cpuc->events[0]; /* PMC0 only */
	struct perf_event *event = cpuc->events[0]; /* PMC0 only */
	struct pebs_record_core *at, *top;
	struct pebs_record_core *at, *top;
	struct perf_sample_data data;
	struct perf_sample_data data;
	struct perf_raw_record raw;
	struct pt_regs regs;
	struct pt_regs regs;
	int n;
	int n;


@@ -479,6 +480,12 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
	perf_sample_data_init(&data, 0);
	perf_sample_data_init(&data, 0);
	data.period = event->hw.last_period;
	data.period = event->hw.last_period;


	if (event->attr.sample_type & PERF_SAMPLE_RAW) {
		raw.size = x86_pmu.pebs_record_size;
		raw.data = at;
		data.raw = &raw;
	}

	n = top - at;
	n = top - at;


	/*
	/*
@@ -521,6 +528,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
	struct pebs_record_nhm *at, *top;
	struct pebs_record_nhm *at, *top;
	struct perf_sample_data data;
	struct perf_sample_data data;
	struct perf_event *event = NULL;
	struct perf_event *event = NULL;
	struct perf_raw_record raw;
	struct pt_regs regs;
	struct pt_regs regs;
	int bit, n;
	int bit, n;


@@ -562,6 +570,12 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
		perf_sample_data_init(&data, 0);
		perf_sample_data_init(&data, 0);
		data.period = event->hw.last_period;
		data.period = event->hw.last_period;


		if (event->attr.sample_type & PERF_SAMPLE_RAW) {
			raw.size = x86_pmu.pebs_record_size;
			raw.data = at;
			data.raw = &raw;
		}

		/*
		/*
		 * See the comment in intel_pmu_drain_pebs_core()
		 * See the comment in intel_pmu_drain_pebs_core()
		 */
		 */