diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-03-27 04:46:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-27 04:46:19 -0400 |
commit | 936c663aed930972f7e185485fd6c2da69e33819 (patch) | |
tree | 41bb069f66e109fc63c4114a4390de44d3068356 /include | |
parent | 072e5a1cfabca7276744d24726e094d85721df5c (diff) | |
parent | 50f16a8bf9d7a92c437ed1867d0f7e1dc6a9aca9 (diff) |
Merge branch 'perf/x86' into perf/core, because it's ready
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_event.h | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index a503100388cc..b16eac5f54ce 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -53,6 +53,7 @@ struct perf_guest_info_callbacks { | |||
53 | #include <linux/sysfs.h> | 53 | #include <linux/sysfs.h> |
54 | #include <linux/perf_regs.h> | 54 | #include <linux/perf_regs.h> |
55 | #include <linux/workqueue.h> | 55 | #include <linux/workqueue.h> |
56 | #include <linux/cgroup.h> | ||
56 | #include <asm/local.h> | 57 | #include <asm/local.h> |
57 | 58 | ||
58 | struct perf_callchain_entry { | 59 | struct perf_callchain_entry { |
@@ -118,10 +119,16 @@ struct hw_perf_event { | |||
118 | struct hrtimer hrtimer; | 119 | struct hrtimer hrtimer; |
119 | }; | 120 | }; |
120 | struct { /* tracepoint */ | 121 | struct { /* tracepoint */ |
121 | struct task_struct *tp_target; | ||
122 | /* for tp_event->class */ | 122 | /* for tp_event->class */ |
123 | struct list_head tp_list; | 123 | struct list_head tp_list; |
124 | }; | 124 | }; |
125 | struct { /* intel_cqm */ | ||
126 | int cqm_state; | ||
127 | int cqm_rmid; | ||
128 | struct list_head cqm_events_entry; | ||
129 | struct list_head cqm_groups_entry; | ||
130 | struct list_head cqm_group_entry; | ||
131 | }; | ||
125 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 132 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
126 | struct { /* breakpoint */ | 133 | struct { /* breakpoint */ |
127 | /* | 134 | /* |
@@ -129,12 +136,12 @@ struct hw_perf_event { | |||
129 | * problem hw_breakpoint has with context | 136 | * problem hw_breakpoint has with context |
130 | * creation and event initalization. | 137 | * creation and event initalization. |
131 | */ | 138 | */ |
132 | struct task_struct *bp_target; | ||
133 | struct arch_hw_breakpoint info; | 139 | struct arch_hw_breakpoint info; |
134 | struct list_head bp_list; | 140 | struct list_head bp_list; |
135 | }; | 141 | }; |
136 | #endif | 142 | #endif |
137 | }; | 143 | }; |
144 | struct task_struct *target; | ||
138 | int state; | 145 | int state; |
139 | local64_t prev_count; | 146 | local64_t prev_count; |
140 | u64 sample_period; | 147 | u64 sample_period; |
@@ -271,6 +278,11 @@ struct pmu { | |||
271 | */ | 278 | */ |
272 | size_t task_ctx_size; | 279 | size_t task_ctx_size; |
273 | 280 | ||
281 | |||
282 | /* | ||
283 | * Return the count value for a counter. | ||
284 | */ | ||
285 | u64 (*count) (struct perf_event *event); /*optional*/ | ||
274 | }; | 286 | }; |
275 | 287 | ||
276 | /** | 288 | /** |
@@ -547,6 +559,35 @@ struct perf_output_handle { | |||
547 | int page; | 559 | int page; |
548 | }; | 560 | }; |
549 | 561 | ||
562 | #ifdef CONFIG_CGROUP_PERF | ||
563 | |||
564 | /* | ||
565 | * perf_cgroup_info keeps track of time_enabled for a cgroup. | ||
566 | * This is a per-cpu dynamically allocated data structure. | ||
567 | */ | ||
568 | struct perf_cgroup_info { | ||
569 | u64 time; | ||
570 | u64 timestamp; | ||
571 | }; | ||
572 | |||
573 | struct perf_cgroup { | ||
574 | struct cgroup_subsys_state css; | ||
575 | struct perf_cgroup_info __percpu *info; | ||
576 | }; | ||
577 | |||
578 | /* | ||
579 | * Must ensure cgroup is pinned (css_get) before calling | ||
580 | * this function. In other words, we cannot call this function | ||
581 | * if there is no cgroup event for the current CPU context. | ||
582 | */ | ||
583 | static inline struct perf_cgroup * | ||
584 | perf_cgroup_from_task(struct task_struct *task) | ||
585 | { | ||
586 | return container_of(task_css(task, perf_event_cgrp_id), | ||
587 | struct perf_cgroup, css); | ||
588 | } | ||
589 | #endif /* CONFIG_CGROUP_PERF */ | ||
590 | |||
550 | #ifdef CONFIG_PERF_EVENTS | 591 | #ifdef CONFIG_PERF_EVENTS |
551 | 592 | ||
552 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); | 593 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); |
@@ -740,6 +781,11 @@ static inline void perf_event_task_sched_out(struct task_struct *prev, | |||
740 | __perf_event_task_sched_out(prev, next); | 781 | __perf_event_task_sched_out(prev, next); |
741 | } | 782 | } |
742 | 783 | ||
784 | static inline u64 __perf_event_count(struct perf_event *event) | ||
785 | { | ||
786 | return local64_read(&event->count) + atomic64_read(&event->child_count); | ||
787 | } | ||
788 | |||
743 | extern void perf_event_mmap(struct vm_area_struct *vma); | 789 | extern void perf_event_mmap(struct vm_area_struct *vma); |
744 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 790 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
745 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 791 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |