diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index dda5b0a3ff60..614615b8d42b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -225,8 +225,14 @@ struct perf_event_attr { | |||
225 | }; | 225 | }; |
226 | 226 | ||
227 | __u32 bp_type; | 227 | __u32 bp_type; |
228 | __u64 bp_addr; | 228 | union { |
229 | __u64 bp_len; | 229 | __u64 bp_addr; |
230 | __u64 config1; /* extension of config */ | ||
231 | }; | ||
232 | union { | ||
233 | __u64 bp_len; | ||
234 | __u64 config2; /* extension of config1 */ | ||
235 | }; | ||
230 | }; | 236 | }; |
231 | 237 | ||
232 | /* | 238 | /* |
@@ -464,6 +470,7 @@ enum perf_callchain_context { | |||
464 | 470 | ||
465 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 471 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
466 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 472 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
473 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ | ||
467 | 474 | ||
468 | #ifdef __KERNEL__ | 475 | #ifdef __KERNEL__ |
469 | /* | 476 | /* |
@@ -471,6 +478,7 @@ enum perf_callchain_context { | |||
471 | */ | 478 | */ |
472 | 479 | ||
473 | #ifdef CONFIG_PERF_EVENTS | 480 | #ifdef CONFIG_PERF_EVENTS |
481 | # include <linux/cgroup.h> | ||
474 | # include <asm/perf_event.h> | 482 | # include <asm/perf_event.h> |
475 | # include <asm/local64.h> | 483 | # include <asm/local64.h> |
476 | #endif | 484 | #endif |
@@ -539,6 +547,9 @@ struct hw_perf_event { | |||
539 | unsigned long event_base; | 547 | unsigned long event_base; |
540 | int idx; | 548 | int idx; |
541 | int last_cpu; | 549 | int last_cpu; |
550 | unsigned int extra_reg; | ||
551 | u64 extra_config; | ||
552 | int extra_alloc; | ||
542 | }; | 553 | }; |
543 | struct { /* software */ | 554 | struct { /* software */ |
544 | struct hrtimer hrtimer; | 555 | struct hrtimer hrtimer; |
@@ -716,6 +727,22 @@ struct swevent_hlist { | |||
716 | #define PERF_ATTACH_GROUP 0x02 | 727 | #define PERF_ATTACH_GROUP 0x02 |
717 | #define PERF_ATTACH_TASK 0x04 | 728 | #define PERF_ATTACH_TASK 0x04 |
718 | 729 | ||
730 | #ifdef CONFIG_CGROUP_PERF | ||
731 | /* | ||
732 | * perf_cgroup_info keeps track of time_enabled for a cgroup. | ||
733 | * This is a per-cpu dynamically allocated data structure. | ||
734 | */ | ||
735 | struct perf_cgroup_info { | ||
736 | u64 time; | ||
737 | u64 timestamp; | ||
738 | }; | ||
739 | |||
740 | struct perf_cgroup { | ||
741 | struct cgroup_subsys_state css; | ||
742 | struct perf_cgroup_info *info; /* timing info, one per cpu */ | ||
743 | }; | ||
744 | #endif | ||
745 | |||
719 | /** | 746 | /** |
720 | * struct perf_event - performance event kernel representation: | 747 | * struct perf_event - performance event kernel representation: |
721 | */ | 748 | */ |
@@ -832,6 +859,11 @@ struct perf_event { | |||
832 | struct event_filter *filter; | 859 | struct event_filter *filter; |
833 | #endif | 860 | #endif |
834 | 861 | ||
862 | #ifdef CONFIG_CGROUP_PERF | ||
863 | struct perf_cgroup *cgrp; /* cgroup event is attach to */ | ||
864 | int cgrp_defer_enabled; | ||
865 | #endif | ||
866 | |||
835 | #endif /* CONFIG_PERF_EVENTS */ | 867 | #endif /* CONFIG_PERF_EVENTS */ |
836 | }; | 868 | }; |
837 | 869 | ||
@@ -886,6 +918,7 @@ struct perf_event_context { | |||
886 | u64 generation; | 918 | u64 generation; |
887 | int pin_count; | 919 | int pin_count; |
888 | struct rcu_head rcu_head; | 920 | struct rcu_head rcu_head; |
921 | int nr_cgroups; /* cgroup events present */ | ||
889 | }; | 922 | }; |
890 | 923 | ||
891 | /* | 924 | /* |
@@ -905,6 +938,9 @@ struct perf_cpu_context { | |||
905 | struct list_head rotation_list; | 938 | struct list_head rotation_list; |
906 | int jiffies_interval; | 939 | int jiffies_interval; |
907 | struct pmu *active_pmu; | 940 | struct pmu *active_pmu; |
941 | #ifdef CONFIG_CGROUP_PERF | ||
942 | struct perf_cgroup *cgrp; | ||
943 | #endif | ||
908 | }; | 944 | }; |
909 | 945 | ||
910 | struct perf_output_handle { | 946 | struct perf_output_handle { |
@@ -1040,11 +1076,11 @@ have_event: | |||
1040 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1076 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1041 | } | 1077 | } |
1042 | 1078 | ||
1043 | extern atomic_t perf_task_events; | 1079 | extern atomic_t perf_sched_events; |
1044 | 1080 | ||
1045 | static inline void perf_event_task_sched_in(struct task_struct *task) | 1081 | static inline void perf_event_task_sched_in(struct task_struct *task) |
1046 | { | 1082 | { |
1047 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | 1083 | COND_STMT(&perf_sched_events, __perf_event_task_sched_in(task)); |
1048 | } | 1084 | } |
1049 | 1085 | ||
1050 | static inline | 1086 | static inline |
@@ -1052,7 +1088,7 @@ void perf_event_task_sched_out(struct task_struct *task, struct task_struct *nex | |||
1052 | { | 1088 | { |
1053 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | 1089 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); |
1054 | 1090 | ||
1055 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | 1091 | COND_STMT(&perf_sched_events, __perf_event_task_sched_out(task, next)); |
1056 | } | 1092 | } |
1057 | 1093 | ||
1058 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1094 | extern void perf_event_mmap(struct vm_area_struct *vma); |
@@ -1083,6 +1119,10 @@ extern int sysctl_perf_event_paranoid; | |||
1083 | extern int sysctl_perf_event_mlock; | 1119 | extern int sysctl_perf_event_mlock; |
1084 | extern int sysctl_perf_event_sample_rate; | 1120 | extern int sysctl_perf_event_sample_rate; |
1085 | 1121 | ||
1122 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | ||
1123 | void __user *buffer, size_t *lenp, | ||
1124 | loff_t *ppos); | ||
1125 | |||
1086 | static inline bool perf_paranoid_tracepoint_raw(void) | 1126 | static inline bool perf_paranoid_tracepoint_raw(void) |
1087 | { | 1127 | { |
1088 | return sysctl_perf_event_paranoid > -1; | 1128 | return sysctl_perf_event_paranoid > -1; |