aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2014-09-24 07:48:37 -0400
committerIngo Molnar <mingo@kernel.org>2014-11-16 05:41:57 -0500
commit60e2364e60e86e81bc6377f49779779e6120977f (patch)
tree669f675c67744cbdd61291f2ec3d03cbb51288d3 /include/linux/perf_event.h
parentaf4bdcf675cf768dc3558682fc178e0e3e70bb52 (diff)
perf: Add ability to sample machine state on interrupt
Enable capture of interrupted machine state for each sample. Registers to sample are passed per event in the sample_regs_intr bitmask. To sample interrupt machine state, the PERF_SAMPLE_INTR_REGS must be passed in sample_type. The list of available registers is arch dependent and provided by asm/perf_regs.h Registers are laid out as u64 in the order of the bit order of sample_intr_regs. This patch also adds a new ABI version PERF_ATTR_SIZE_VER4 because we extend the perf_event_attr struct with a new u64 field. Reviewed-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: cebbert.lkml@gmail.com Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-api@vger.kernel.org Link: http://lkml.kernel.org/r/1411559322-16548-2-git-send-email-eranian@google.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 893a0d07986f..68d46d536e24 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -79,7 +79,7 @@ struct perf_branch_stack {
79 struct perf_branch_entry entries[0]; 79 struct perf_branch_entry entries[0];
80}; 80};
81 81
82struct perf_regs_user { 82struct perf_regs {
83 __u64 abi; 83 __u64 abi;
84 struct pt_regs *regs; 84 struct pt_regs *regs;
85}; 85};
@@ -600,7 +600,8 @@ struct perf_sample_data {
600 struct perf_callchain_entry *callchain; 600 struct perf_callchain_entry *callchain;
601 struct perf_raw_record *raw; 601 struct perf_raw_record *raw;
602 struct perf_branch_stack *br_stack; 602 struct perf_branch_stack *br_stack;
603 struct perf_regs_user regs_user; 603 struct perf_regs regs_user;
604 struct perf_regs regs_intr;
604 u64 stack_user_size; 605 u64 stack_user_size;
605 u64 weight; 606 u64 weight;
606 /* 607 /*
@@ -630,6 +631,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
630 data->weight = 0; 631 data->weight = 0;
631 data->data_src.val = PERF_MEM_NA; 632 data->data_src.val = PERF_MEM_NA;
632 data->txn = 0; 633 data->txn = 0;
634 data->regs_intr.abi = PERF_SAMPLE_REGS_ABI_NONE;
635 data->regs_intr.regs = NULL;
633} 636}
634 637
635extern void perf_output_sample(struct perf_output_handle *handle, 638extern void perf_output_sample(struct perf_output_handle *handle,