aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-09-07 11:34:50 -0400
committerIngo Molnar <mingo@elte.hu>2010-09-09 14:46:34 -0400
commit89a1e18731959e9953fae15ddc1a983eb15a4f19 (patch)
tree5a52e77acb23f47254c94e23eb6ed35a422fce1d /include/linux/perf_event.h
parent8dc85d547285668e509f86c177bcd4ea055bcaaf (diff)
perf: Provide a separate task context for swevents
Since software events are always schedulable, mixing them up with hardware events (who are not) can lead to funny scheduling oddities. Giving them their own context solves this. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: paulus <paulus@samba.org> Cc: stephane eranian <eranian@googlemail.com> Cc: Robert Richter <robert.richter@amd.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Lin Ming <ming.m.lin@intel.com> Cc: Yanmin <yanmin_zhang@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 9ecfd856ce6e..c1173520f14d 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -952,14 +952,7 @@ extern int perf_event_overflow(struct perf_event *event, int nmi,
952 */ 952 */
953static inline int is_software_event(struct perf_event *event) 953static inline int is_software_event(struct perf_event *event)
954{ 954{
955 switch (event->attr.type) { 955 return event->pmu->task_ctx_nr == perf_sw_context;
956 case PERF_TYPE_SOFTWARE:
957 case PERF_TYPE_TRACEPOINT:
958 /* for now the breakpoint stuff also works as software event */
959 case PERF_TYPE_BREAKPOINT:
960 return 1;
961 }
962 return 0;
963} 956}
964 957
965extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; 958extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];