diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-03-04 06:38:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-10 07:23:33 -0500 |
commit | 7e1a40dda619b0483fbe0740494ed2c2a1f05289 (patch) | |
tree | a385d61df1907fe8295ed680d468a0a2a552cc6a /arch | |
parent | 8db909a7e3c888b5d45aef7650d74ccebe3ce725 (diff) |
perf, x86: Expose the full PEBS record using PERF_SAMPLE_RAW
Expose the full PEBS record using PERF_SAMPLE_RAW
Signed-off-by: Peter 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel_ds.c | 14 |
1 files changed, 14 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 5e4029441b2d..ef56f053ab31 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c | |||
@@ -457,6 +457,7 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs) | |||
457 | struct perf_event *event = cpuc->events[0]; /* PMC0 only */ | 457 | struct perf_event *event = cpuc->events[0]; /* PMC0 only */ |
458 | struct pebs_record_core *at, *top; | 458 | struct pebs_record_core *at, *top; |
459 | struct perf_sample_data data; | 459 | struct perf_sample_data data; |
460 | struct perf_raw_record raw; | ||
460 | struct pt_regs regs; | 461 | struct pt_regs regs; |
461 | int n; | 462 | int n; |
462 | 463 | ||
@@ -479,6 +480,12 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs) | |||
479 | perf_sample_data_init(&data, 0); | 480 | perf_sample_data_init(&data, 0); |
480 | data.period = event->hw.last_period; | 481 | data.period = event->hw.last_period; |
481 | 482 | ||
483 | if (event->attr.sample_type & PERF_SAMPLE_RAW) { | ||
484 | raw.size = x86_pmu.pebs_record_size; | ||
485 | raw.data = at; | ||
486 | data.raw = &raw; | ||
487 | } | ||
488 | |||
482 | n = top - at; | 489 | n = top - at; |
483 | 490 | ||
484 | /* | 491 | /* |
@@ -521,6 +528,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs) | |||
521 | struct pebs_record_nhm *at, *top; | 528 | struct pebs_record_nhm *at, *top; |
522 | struct perf_sample_data data; | 529 | struct perf_sample_data data; |
523 | struct perf_event *event = NULL; | 530 | struct perf_event *event = NULL; |
531 | struct perf_raw_record raw; | ||
524 | struct pt_regs regs; | 532 | struct pt_regs regs; |
525 | int bit, n; | 533 | int bit, n; |
526 | 534 | ||
@@ -562,6 +570,12 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs) | |||
562 | perf_sample_data_init(&data, 0); | 570 | perf_sample_data_init(&data, 0); |
563 | data.period = event->hw.last_period; | 571 | data.period = event->hw.last_period; |
564 | 572 | ||
573 | if (event->attr.sample_type & PERF_SAMPLE_RAW) { | ||
574 | raw.size = x86_pmu.pebs_record_size; | ||
575 | raw.data = at; | ||
576 | data.raw = &raw; | ||
577 | } | ||
578 | |||
565 | /* | 579 | /* |
566 | * See the comment in intel_pmu_drain_pebs_core() | 580 | * See the comment in intel_pmu_drain_pebs_core() |
567 | */ | 581 | */ |