diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-11 09:17:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-11 09:45:56 -0500 |
commit | 6a930700c8b655a9e25e42fc4adc0b225ebbcefc (patch) | |
tree | 5b6aa07d2734f43d0c5bc7d97aebe256e6d86fa8 /include/linux/perf_counter.h | |
parent | 1d1c7ddbfab358445a542715551301b7fc363e28 (diff) |
perf counters: clean up state transitions
Impact: cleanup
Introduce a proper enum for the 3 states of a counter:
PERF_COUNTER_STATE_OFF = -1
PERF_COUNTER_STATE_INACTIVE = 0
PERF_COUNTER_STATE_ACTIVE = 1
and rename counter->active to counter->state and propagate the
changes everywhere.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 97d86c293ee8..8cb095fa442c 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -128,6 +128,15 @@ struct hw_perf_counter_ops { | |||
128 | }; | 128 | }; |
129 | 129 | ||
130 | /** | 130 | /** |
131 | * enum perf_counter_active_state - the states of a counter | ||
132 | */ | ||
133 | enum perf_counter_active_state { | ||
134 | PERF_COUNTER_STATE_OFF = -1, | ||
135 | PERF_COUNTER_STATE_INACTIVE = 0, | ||
136 | PERF_COUNTER_STATE_ACTIVE = 1, | ||
137 | }; | ||
138 | |||
139 | /** | ||
131 | * struct perf_counter - performance counter kernel representation: | 140 | * struct perf_counter - performance counter kernel representation: |
132 | */ | 141 | */ |
133 | struct perf_counter { | 142 | struct perf_counter { |
@@ -136,7 +145,7 @@ struct perf_counter { | |||
136 | struct perf_counter *group_leader; | 145 | struct perf_counter *group_leader; |
137 | const struct hw_perf_counter_ops *hw_ops; | 146 | const struct hw_perf_counter_ops *hw_ops; |
138 | 147 | ||
139 | int active; | 148 | enum perf_counter_active_state state; |
140 | #if BITS_PER_LONG == 64 | 149 | #if BITS_PER_LONG == 64 |
141 | atomic64_t count; | 150 | atomic64_t count; |
142 | #else | 151 | #else |