mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 04:59:05 -04:00
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>
This commit is contained in:
parent
1d1c7ddbfa
commit
6a930700c8
3 changed files with 25 additions and 17 deletions
|
|
@ -127,6 +127,15 @@ struct hw_perf_counter_ops {
|
|||
void (*hw_perf_counter_read) (struct perf_counter *counter);
|
||||
};
|
||||
|
||||
/**
|
||||
* enum perf_counter_active_state - the states of a counter
|
||||
*/
|
||||
enum perf_counter_active_state {
|
||||
PERF_COUNTER_STATE_OFF = -1,
|
||||
PERF_COUNTER_STATE_INACTIVE = 0,
|
||||
PERF_COUNTER_STATE_ACTIVE = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct perf_counter - performance counter kernel representation:
|
||||
*/
|
||||
|
|
@ -136,7 +145,7 @@ struct perf_counter {
|
|||
struct perf_counter *group_leader;
|
||||
const struct hw_perf_counter_ops *hw_ops;
|
||||
|
||||
int active;
|
||||
enum perf_counter_active_state state;
|
||||
#if BITS_PER_LONG == 64
|
||||
atomic64_t count;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue