aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
committerIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
commit2a2662bf88e693d477ef08351d03934f7bc0b51c (patch)
treecef243df159cc12ada7e97998a253df7c0abb2a2 /include
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
parent36748b9518a2437beffe861b47dff6d12b736b3f (diff)
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker: " - Extend breakpoint tools and core to support address range through perf event with initial backend support for AMD extended breakpoints. Syntax is: perf record -e mem:addr/len:type For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512) perf record -e mem:0x1000/512:w - Clean up a bit breakpoint code validation It has been acked by Jiri and Oleg. " Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_event.h37
-rw-r--r--include/uapi/linux/perf_event.h15
2 files changed, 34 insertions, 18 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 893a0d07986f..486e84ccb1f9 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};
@@ -580,34 +580,40 @@ extern u64 perf_event_read_value(struct perf_event *event,
580 580
581 581
582struct perf_sample_data { 582struct perf_sample_data {
583 u64 type; 583 /*
584 * Fields set by perf_sample_data_init(), group so as to
585 * minimize the cachelines touched.
586 */
587 u64 addr;
588 struct perf_raw_record *raw;
589 struct perf_branch_stack *br_stack;
590 u64 period;
591 u64 weight;
592 u64 txn;
593 union perf_mem_data_src data_src;
584 594
595 /*
596 * The other fields, optionally {set,used} by
597 * perf_{prepare,output}_sample().
598 */
599 u64 type;
585 u64 ip; 600 u64 ip;
586 struct { 601 struct {
587 u32 pid; 602 u32 pid;
588 u32 tid; 603 u32 tid;
589 } tid_entry; 604 } tid_entry;
590 u64 time; 605 u64 time;
591 u64 addr;
592 u64 id; 606 u64 id;
593 u64 stream_id; 607 u64 stream_id;
594 struct { 608 struct {
595 u32 cpu; 609 u32 cpu;
596 u32 reserved; 610 u32 reserved;
597 } cpu_entry; 611 } cpu_entry;
598 u64 period;
599 union perf_mem_data_src data_src;
600 struct perf_callchain_entry *callchain; 612 struct perf_callchain_entry *callchain;
601 struct perf_raw_record *raw; 613 struct perf_regs regs_user;
602 struct perf_branch_stack *br_stack; 614 struct perf_regs regs_intr;
603 struct perf_regs_user regs_user;
604 u64 stack_user_size; 615 u64 stack_user_size;
605 u64 weight; 616} ____cacheline_aligned;
606 /*
607 * Transaction flags for abort events:
608 */
609 u64 txn;
610};
611 617
612/* default value for data source */ 618/* default value for data source */
613#define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\ 619#define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\
@@ -624,9 +630,6 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
624 data->raw = NULL; 630 data->raw = NULL;
625 data->br_stack = NULL; 631 data->br_stack = NULL;
626 data->period = period; 632 data->period = period;
627 data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE;
628 data->regs_user.regs = NULL;
629 data->stack_user_size = 0;
630 data->weight = 0; 633 data->weight = 0;
631 data->data_src.val = PERF_MEM_NA; 634 data->data_src.val = PERF_MEM_NA;
632 data->txn = 0; 635 data->txn = 0;
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 9d845404d875..9b79abbd1ab8 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -137,8 +137,9 @@ enum perf_event_sample_format {
137 PERF_SAMPLE_DATA_SRC = 1U << 15, 137 PERF_SAMPLE_DATA_SRC = 1U << 15,
138 PERF_SAMPLE_IDENTIFIER = 1U << 16, 138 PERF_SAMPLE_IDENTIFIER = 1U << 16,
139 PERF_SAMPLE_TRANSACTION = 1U << 17, 139 PERF_SAMPLE_TRANSACTION = 1U << 17,
140 PERF_SAMPLE_REGS_INTR = 1U << 18,
140 141
141 PERF_SAMPLE_MAX = 1U << 18, /* non-ABI */ 142 PERF_SAMPLE_MAX = 1U << 19, /* non-ABI */
142}; 143};
143 144
144/* 145/*
@@ -238,6 +239,7 @@ enum perf_event_read_format {
238#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ 239#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */
239#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */ 240#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
240 /* add: sample_stack_user */ 241 /* add: sample_stack_user */
242#define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */
241 243
242/* 244/*
243 * Hardware event_id to monitor via a performance monitoring event: 245 * Hardware event_id to monitor via a performance monitoring event:
@@ -334,6 +336,15 @@ struct perf_event_attr {
334 336
335 /* Align to u64. */ 337 /* Align to u64. */
336 __u32 __reserved_2; 338 __u32 __reserved_2;
339 /*
340 * Defines set of regs to dump for each sample
341 * state captured on:
342 * - precise = 0: PMU interrupt
343 * - precise > 0: sampled instruction
344 *
345 * See asm/perf_regs.h for details.
346 */
347 __u64 sample_regs_intr;
337}; 348};
338 349
339#define perf_flags(attr) (*(&(attr)->read_format + 1)) 350#define perf_flags(attr) (*(&(attr)->read_format + 1))
@@ -686,6 +697,8 @@ enum perf_event_type {
686 * { u64 weight; } && PERF_SAMPLE_WEIGHT 697 * { u64 weight; } && PERF_SAMPLE_WEIGHT
687 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC 698 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC
688 * { u64 transaction; } && PERF_SAMPLE_TRANSACTION 699 * { u64 transaction; } && PERF_SAMPLE_TRANSACTION
700 * { u64 abi; # enum perf_sample_regs_abi
701 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
689 * }; 702 * };
690 */ 703 */
691 PERF_RECORD_SAMPLE = 9, 704 PERF_RECORD_SAMPLE = 9,