diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index a177698d95e2..7b18b4fd5df7 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -288,7 +288,7 @@ struct perf_event_mmap_page { | |||
288 | }; | 288 | }; |
289 | 289 | ||
290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) |
291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
293 | #define PERF_RECORD_MISC_USER (2 << 0) | 293 | #define PERF_RECORD_MISC_USER (2 << 0) |
294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
@@ -354,8 +354,8 @@ enum perf_event_type { | |||
354 | * u64 stream_id; | 354 | * u64 stream_id; |
355 | * }; | 355 | * }; |
356 | */ | 356 | */ |
357 | PERF_RECORD_THROTTLE = 5, | 357 | PERF_RECORD_THROTTLE = 5, |
358 | PERF_RECORD_UNTHROTTLE = 6, | 358 | PERF_RECORD_UNTHROTTLE = 6, |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * struct { | 361 | * struct { |
@@ -369,10 +369,10 @@ enum perf_event_type { | |||
369 | 369 | ||
370 | /* | 370 | /* |
371 | * struct { | 371 | * struct { |
372 | * struct perf_event_header header; | 372 | * struct perf_event_header header; |
373 | * u32 pid, tid; | 373 | * u32 pid, tid; |
374 | * | 374 | * |
375 | * struct read_format values; | 375 | * struct read_format values; |
376 | * }; | 376 | * }; |
377 | */ | 377 | */ |
378 | PERF_RECORD_READ = 8, | 378 | PERF_RECORD_READ = 8, |
@@ -410,7 +410,7 @@ enum perf_event_type { | |||
410 | * char data[size];}&& PERF_SAMPLE_RAW | 410 | * char data[size];}&& PERF_SAMPLE_RAW |
411 | * }; | 411 | * }; |
412 | */ | 412 | */ |
413 | PERF_RECORD_SAMPLE = 9, | 413 | PERF_RECORD_SAMPLE = 9, |
414 | 414 | ||
415 | PERF_RECORD_MAX, /* non-ABI */ | 415 | PERF_RECORD_MAX, /* non-ABI */ |
416 | }; | 416 | }; |
@@ -476,9 +476,11 @@ struct hw_perf_event { | |||
476 | union { | 476 | union { |
477 | struct { /* hardware */ | 477 | struct { /* hardware */ |
478 | u64 config; | 478 | u64 config; |
479 | u64 last_tag; | ||
479 | unsigned long config_base; | 480 | unsigned long config_base; |
480 | unsigned long event_base; | 481 | unsigned long event_base; |
481 | int idx; | 482 | int idx; |
483 | int last_cpu; | ||
482 | }; | 484 | }; |
483 | struct { /* software */ | 485 | struct { /* software */ |
484 | s64 remaining; | 486 | s64 remaining; |
@@ -496,9 +498,8 @@ struct hw_perf_event { | |||
496 | atomic64_t period_left; | 498 | atomic64_t period_left; |
497 | u64 interrupts; | 499 | u64 interrupts; |
498 | 500 | ||
499 | u64 freq_count; | 501 | u64 freq_time_stamp; |
500 | u64 freq_interrupts; | 502 | u64 freq_count_stamp; |
501 | u64 freq_stamp; | ||
502 | #endif | 503 | #endif |
503 | }; | 504 | }; |
504 | 505 | ||
@@ -510,6 +511,8 @@ struct perf_event; | |||
510 | struct pmu { | 511 | struct pmu { |
511 | int (*enable) (struct perf_event *event); | 512 | int (*enable) (struct perf_event *event); |
512 | void (*disable) (struct perf_event *event); | 513 | void (*disable) (struct perf_event *event); |
514 | int (*start) (struct perf_event *event); | ||
515 | void (*stop) (struct perf_event *event); | ||
513 | void (*read) (struct perf_event *event); | 516 | void (*read) (struct perf_event *event); |
514 | void (*unthrottle) (struct perf_event *event); | 517 | void (*unthrottle) (struct perf_event *event); |
515 | }; | 518 | }; |
@@ -563,6 +566,10 @@ typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | |||
563 | struct perf_sample_data *, | 566 | struct perf_sample_data *, |
564 | struct pt_regs *regs); | 567 | struct pt_regs *regs); |
565 | 568 | ||
569 | enum perf_group_flag { | ||
570 | PERF_GROUP_SOFTWARE = 0x1, | ||
571 | }; | ||
572 | |||
566 | /** | 573 | /** |
567 | * struct perf_event - performance event kernel representation: | 574 | * struct perf_event - performance event kernel representation: |
568 | */ | 575 | */ |
@@ -572,6 +579,7 @@ struct perf_event { | |||
572 | struct list_head event_entry; | 579 | struct list_head event_entry; |
573 | struct list_head sibling_list; | 580 | struct list_head sibling_list; |
574 | int nr_siblings; | 581 | int nr_siblings; |
582 | int group_flags; | ||
575 | struct perf_event *group_leader; | 583 | struct perf_event *group_leader; |
576 | struct perf_event *output; | 584 | struct perf_event *output; |
577 | const struct pmu *pmu; | 585 | const struct pmu *pmu; |
@@ -656,7 +664,7 @@ struct perf_event { | |||
656 | 664 | ||
657 | perf_overflow_handler_t overflow_handler; | 665 | perf_overflow_handler_t overflow_handler; |
658 | 666 | ||
659 | #ifdef CONFIG_EVENT_PROFILE | 667 | #ifdef CONFIG_EVENT_TRACING |
660 | struct event_filter *filter; | 668 | struct event_filter *filter; |
661 | #endif | 669 | #endif |
662 | 670 | ||
@@ -681,7 +689,8 @@ struct perf_event_context { | |||
681 | */ | 689 | */ |
682 | struct mutex mutex; | 690 | struct mutex mutex; |
683 | 691 | ||
684 | struct list_head group_list; | 692 | struct list_head pinned_groups; |
693 | struct list_head flexible_groups; | ||
685 | struct list_head event_list; | 694 | struct list_head event_list; |
686 | int nr_events; | 695 | int nr_events; |
687 | int nr_active; | 696 | int nr_active; |
@@ -744,10 +753,9 @@ extern int perf_max_events; | |||
744 | 753 | ||
745 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); | 754 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); |
746 | 755 | ||
747 | extern void perf_event_task_sched_in(struct task_struct *task, int cpu); | 756 | extern void perf_event_task_sched_in(struct task_struct *task); |
748 | extern void perf_event_task_sched_out(struct task_struct *task, | 757 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
749 | struct task_struct *next, int cpu); | 758 | extern void perf_event_task_tick(struct task_struct *task); |
750 | extern void perf_event_task_tick(struct task_struct *task, int cpu); | ||
751 | extern int perf_event_init_task(struct task_struct *child); | 759 | extern int perf_event_init_task(struct task_struct *child); |
752 | extern void perf_event_exit_task(struct task_struct *child); | 760 | extern void perf_event_exit_task(struct task_struct *child); |
753 | extern void perf_event_free_task(struct task_struct *task); | 761 | extern void perf_event_free_task(struct task_struct *task); |
@@ -762,7 +770,7 @@ extern int perf_event_task_disable(void); | |||
762 | extern int perf_event_task_enable(void); | 770 | extern int perf_event_task_enable(void); |
763 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, | 771 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, |
764 | struct perf_cpu_context *cpuctx, | 772 | struct perf_cpu_context *cpuctx, |
765 | struct perf_event_context *ctx, int cpu); | 773 | struct perf_event_context *ctx); |
766 | extern void perf_event_update_userpage(struct perf_event *event); | 774 | extern void perf_event_update_userpage(struct perf_event *event); |
767 | extern int perf_event_release_kernel(struct perf_event *event); | 775 | extern int perf_event_release_kernel(struct perf_event *event); |
768 | extern struct perf_event * | 776 | extern struct perf_event * |
@@ -851,8 +859,7 @@ extern int sysctl_perf_event_mlock; | |||
851 | extern int sysctl_perf_event_sample_rate; | 859 | extern int sysctl_perf_event_sample_rate; |
852 | 860 | ||
853 | extern void perf_event_init(void); | 861 | extern void perf_event_init(void); |
854 | extern void perf_tp_event(int event_id, u64 addr, u64 count, | 862 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); |
855 | void *record, int entry_size); | ||
856 | extern void perf_bp_event(struct perf_event *event, void *data); | 863 | extern void perf_bp_event(struct perf_event *event, void *data); |
857 | 864 | ||
858 | #ifndef perf_misc_flags | 865 | #ifndef perf_misc_flags |
@@ -873,12 +880,12 @@ extern void perf_event_enable(struct perf_event *event); | |||
873 | extern void perf_event_disable(struct perf_event *event); | 880 | extern void perf_event_disable(struct perf_event *event); |
874 | #else | 881 | #else |
875 | static inline void | 882 | static inline void |
876 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 883 | perf_event_task_sched_in(struct task_struct *task) { } |
877 | static inline void | 884 | static inline void |
878 | perf_event_task_sched_out(struct task_struct *task, | 885 | perf_event_task_sched_out(struct task_struct *task, |
879 | struct task_struct *next, int cpu) { } | 886 | struct task_struct *next) { } |
880 | static inline void | 887 | static inline void |
881 | perf_event_task_tick(struct task_struct *task, int cpu) { } | 888 | perf_event_task_tick(struct task_struct *task) { } |
882 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 889 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
883 | static inline void perf_event_exit_task(struct task_struct *child) { } | 890 | static inline void perf_event_exit_task(struct task_struct *child) { } |
884 | static inline void perf_event_free_task(struct task_struct *task) { } | 891 | static inline void perf_event_free_task(struct task_struct *task) { } |
@@ -893,13 +900,13 @@ static inline void | |||
893 | perf_sw_event(u32 event_id, u64 nr, int nmi, | 900 | perf_sw_event(u32 event_id, u64 nr, int nmi, |
894 | struct pt_regs *regs, u64 addr) { } | 901 | struct pt_regs *regs, u64 addr) { } |
895 | static inline void | 902 | static inline void |
896 | perf_bp_event(struct perf_event *event, void *data) { } | 903 | perf_bp_event(struct perf_event *event, void *data) { } |
897 | 904 | ||
898 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 905 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
899 | static inline void perf_event_comm(struct task_struct *tsk) { } | 906 | static inline void perf_event_comm(struct task_struct *tsk) { } |
900 | static inline void perf_event_fork(struct task_struct *tsk) { } | 907 | static inline void perf_event_fork(struct task_struct *tsk) { } |
901 | static inline void perf_event_init(void) { } | 908 | static inline void perf_event_init(void) { } |
902 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 909 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
903 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 910 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
904 | static inline void perf_event_enable(struct perf_event *event) { } | 911 | static inline void perf_event_enable(struct perf_event *event) { } |
905 | static inline void perf_event_disable(struct perf_event *event) { } | 912 | static inline void perf_event_disable(struct perf_event *event) { } |