diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_event.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index cae4a9481777..9fc9b0d31442 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -272,6 +272,11 @@ struct pmu { | |||
272 | */ | 272 | */ |
273 | size_t task_ctx_size; | 273 | size_t task_ctx_size; |
274 | 274 | ||
275 | |||
276 | /* | ||
277 | * Return the count value for a counter. | ||
278 | */ | ||
279 | u64 (*count) (struct perf_event *event); /*optional*/ | ||
275 | }; | 280 | }; |
276 | 281 | ||
277 | /** | 282 | /** |
@@ -770,6 +775,11 @@ static inline void perf_event_task_sched_out(struct task_struct *prev, | |||
770 | __perf_event_task_sched_out(prev, next); | 775 | __perf_event_task_sched_out(prev, next); |
771 | } | 776 | } |
772 | 777 | ||
778 | static inline u64 __perf_event_count(struct perf_event *event) | ||
779 | { | ||
780 | return local64_read(&event->count) + atomic64_read(&event->child_count); | ||
781 | } | ||
782 | |||
773 | extern void perf_event_mmap(struct vm_area_struct *vma); | 783 | extern void perf_event_mmap(struct vm_area_struct *vma); |
774 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 784 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
775 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 785 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |