diff options
-rw-r--r-- | include/linux/perf_event.h | 6 | ||||
-rw-r--r-- | kernel/events/core.c | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index e47ee462c2f2..0140830225e2 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -799,6 +799,12 @@ static inline int __perf_event_disable(void *info) { return -1; } | |||
799 | static inline void perf_event_task_tick(void) { } | 799 | static inline void perf_event_task_tick(void) { } |
800 | #endif | 800 | #endif |
801 | 801 | ||
802 | #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_NO_HZ_FULL) | ||
803 | extern bool perf_event_can_stop_tick(void); | ||
804 | #else | ||
805 | static inline bool perf_event_can_stop_tick(void) { return true; } | ||
806 | #endif | ||
807 | |||
802 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) | 808 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) |
803 | 809 | ||
804 | /* | 810 | /* |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 75b58bb75b32..ddb993b52190 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -2560,6 +2560,16 @@ done: | |||
2560 | list_del_init(&cpuctx->rotation_list); | 2560 | list_del_init(&cpuctx->rotation_list); |
2561 | } | 2561 | } |
2562 | 2562 | ||
2563 | #ifdef CONFIG_NO_HZ_FULL | ||
2564 | bool perf_event_can_stop_tick(void) | ||
2565 | { | ||
2566 | if (list_empty(&__get_cpu_var(rotation_list))) | ||
2567 | return true; | ||
2568 | else | ||
2569 | return false; | ||
2570 | } | ||
2571 | #endif | ||
2572 | |||
2563 | void perf_event_task_tick(void) | 2573 | void perf_event_task_tick(void) |
2564 | { | 2574 | { |
2565 | struct list_head *head = &__get_cpu_var(rotation_list); | 2575 | struct list_head *head = &__get_cpu_var(rotation_list); |