aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index b21d1ea4c054..7ab8e5f96f5b 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -86,7 +86,10 @@ struct perf_counter_hw_event {
86 nmi : 1, /* NMI sampling */ 86 nmi : 1, /* NMI sampling */
87 raw : 1, /* raw event type */ 87 raw : 1, /* raw event type */
88 inherit : 1, /* children inherit it */ 88 inherit : 1, /* children inherit it */
89 __reserved_1 : 28; 89 pinned : 1, /* must always be on PMU */
90 exclusive : 1, /* only counter on PMU */
91
92 __reserved_1 : 26;
90 93
91 u64 __reserved_2; 94 u64 __reserved_2;
92}; 95};
@@ -141,6 +144,7 @@ struct hw_perf_counter_ops {
141 * enum perf_counter_active_state - the states of a counter 144 * enum perf_counter_active_state - the states of a counter
142 */ 145 */
143enum perf_counter_active_state { 146enum perf_counter_active_state {
147 PERF_COUNTER_STATE_ERROR = -2,
144 PERF_COUNTER_STATE_OFF = -1, 148 PERF_COUNTER_STATE_OFF = -1,
145 PERF_COUNTER_STATE_INACTIVE = 0, 149 PERF_COUNTER_STATE_INACTIVE = 0,
146 PERF_COUNTER_STATE_ACTIVE = 1, 150 PERF_COUNTER_STATE_ACTIVE = 1,
@@ -214,6 +218,7 @@ struct perf_cpu_context {
214 struct perf_counter_context *task_ctx; 218 struct perf_counter_context *task_ctx;
215 int active_oncpu; 219 int active_oncpu;
216 int max_pertask; 220 int max_pertask;
221 int exclusive;
217}; 222};
218 223
219/* 224/*
@@ -240,6 +245,14 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
240 struct perf_cpu_context *cpuctx, 245 struct perf_cpu_context *cpuctx,
241 struct perf_counter_context *ctx, int cpu); 246 struct perf_counter_context *ctx, int cpu);
242 247
248/*
249 * Return 1 for a software counter, 0 for a hardware counter
250 */
251static inline int is_software_counter(struct perf_counter *counter)
252{
253 return !counter->hw_event.raw && counter->hw_event.type < 0;
254}
255
243#else 256#else
244static inline void 257static inline void
245perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 258perf_counter_task_sched_in(struct task_struct *task, int cpu) { }