diff options
-rw-r--r-- | kernel/perf_event.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 73329dedb5ad..d8108465397d 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -93,25 +93,15 @@ void __weak perf_event_print_debug(void) { } | |||
93 | 93 | ||
94 | static DEFINE_PER_CPU(int, perf_disable_count); | 94 | static DEFINE_PER_CPU(int, perf_disable_count); |
95 | 95 | ||
96 | void __perf_disable(void) | ||
97 | { | ||
98 | __get_cpu_var(perf_disable_count)++; | ||
99 | } | ||
100 | |||
101 | bool __perf_enable(void) | ||
102 | { | ||
103 | return !--__get_cpu_var(perf_disable_count); | ||
104 | } | ||
105 | |||
106 | void perf_disable(void) | 96 | void perf_disable(void) |
107 | { | 97 | { |
108 | __perf_disable(); | 98 | if (!__get_cpu_var(perf_disable_count)++) |
109 | hw_perf_disable(); | 99 | hw_perf_disable(); |
110 | } | 100 | } |
111 | 101 | ||
112 | void perf_enable(void) | 102 | void perf_enable(void) |
113 | { | 103 | { |
114 | if (__perf_enable()) | 104 | if (!--__get_cpu_var(perf_disable_count)) |
115 | hw_perf_enable(); | 105 | hw_perf_enable(); |
116 | } | 106 | } |
117 | 107 | ||