diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/perf_event.h | 17 | ||||
| -rw-r--r-- | include/uapi/linux/perf_event.h | 16 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 401554074de9..5a94f6d6fa91 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -284,6 +284,18 @@ struct pmu { | |||
| 284 | * Return the count value for a counter. | 284 | * Return the count value for a counter. |
| 285 | */ | 285 | */ |
| 286 | u64 (*count) (struct perf_event *event); /*optional*/ | 286 | u64 (*count) (struct perf_event *event); /*optional*/ |
| 287 | |||
| 288 | /* | ||
| 289 | * Set up pmu-private data structures for an AUX area | ||
| 290 | */ | ||
| 291 | void *(*setup_aux) (int cpu, void **pages, | ||
| 292 | int nr_pages, bool overwrite); | ||
| 293 | /* optional */ | ||
| 294 | |||
| 295 | /* | ||
| 296 | * Free pmu-private AUX data structures | ||
| 297 | */ | ||
| 298 | void (*free_aux) (void *aux); /* optional */ | ||
| 287 | }; | 299 | }; |
| 288 | 300 | ||
| 289 | /** | 301 | /** |
| @@ -862,6 +874,11 @@ static inline bool needs_branch_stack(struct perf_event *event) | |||
| 862 | return event->attr.branch_sample_type != 0; | 874 | return event->attr.branch_sample_type != 0; |
| 863 | } | 875 | } |
| 864 | 876 | ||
| 877 | static inline bool has_aux(struct perf_event *event) | ||
| 878 | { | ||
| 879 | return event->pmu->setup_aux; | ||
| 880 | } | ||
| 881 | |||
| 865 | extern int perf_output_begin(struct perf_output_handle *handle, | 882 | extern int perf_output_begin(struct perf_output_handle *handle, |
| 866 | struct perf_event *event, unsigned int size); | 883 | struct perf_event *event, unsigned int size); |
| 867 | extern void perf_output_end(struct perf_output_handle *handle); | 884 | extern void perf_output_end(struct perf_output_handle *handle); |
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 86c44ae66d43..6c5013a71714 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
| @@ -530,6 +530,22 @@ struct perf_event_mmap_page { | |||
| 530 | __u64 data_tail; /* user-space written tail */ | 530 | __u64 data_tail; /* user-space written tail */ |
| 531 | __u64 data_offset; /* where the buffer starts */ | 531 | __u64 data_offset; /* where the buffer starts */ |
| 532 | __u64 data_size; /* data buffer size */ | 532 | __u64 data_size; /* data buffer size */ |
| 533 | |||
| 534 | /* | ||
| 535 | * AUX area is defined by aux_{offset,size} fields that should be set | ||
| 536 | * by the userspace, so that | ||
| 537 | * | ||
| 538 | * aux_offset >= data_offset + data_size | ||
| 539 | * | ||
| 540 | * prior to mmap()ing it. Size of the mmap()ed area should be aux_size. | ||
| 541 | * | ||
| 542 | * Ring buffer pointers aux_{head,tail} have the same semantics as | ||
| 543 | * data_{head,tail} and same ordering rules apply. | ||
| 544 | */ | ||
| 545 | __u64 aux_head; | ||
| 546 | __u64 aux_tail; | ||
| 547 | __u64 aux_offset; | ||
| 548 | __u64 aux_size; | ||
| 533 | }; | 549 | }; |
| 534 | 550 | ||
| 535 | #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) | 551 | #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) |
