瀏覽代碼

lockup_detector: Adapt CONFIG_PERF_EVENT_NMI to other archs

CONFIG_PERF_EVENT_NMI is something that need to be enabled from the
arch. This is fine on x86 as PERF_EVENTS is builtin but if other
archs select it, they will need to handle the PERF_EVENTS dependency.

Instead, handle the dependency in the generic layer:

- archs need to tell what they support through HAVE_PERF_EVENTS_NMI
- Enable magically PERF_EVENTS_NMI if we have PERF_EVENTS and
  HAVE_PERF_EVENTS_NMI.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Frederic Weisbecker 15 年之前
父節點
當前提交
c01d432330
共有 3 個文件被更改,包括 5 次插入3 次删除
  1. 3 0
      arch/Kconfig
  2. 1 1
      arch/x86/Kconfig
  3. 1 2
      init/Kconfig

+ 3 - 0
arch/Kconfig

@@ -145,4 +145,7 @@ config HAVE_HW_BREAKPOINT
 config HAVE_USER_RETURN_NOTIFIER
 config HAVE_USER_RETURN_NOTIFIER
 	bool
 	bool
 
 
+config HAVE_PERF_EVENTS_NMI
+	bool
+
 source "kernel/gcov/Kconfig"
 source "kernel/gcov/Kconfig"

+ 1 - 1
arch/x86/Kconfig

@@ -54,7 +54,7 @@ config X86
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZO
 	select HAVE_HW_BREAKPOINT
 	select HAVE_HW_BREAKPOINT
 	select PERF_EVENTS
 	select PERF_EVENTS
-	select PERF_EVENTS_NMI
+	select HAVE_PERF_EVENTS_NMI
 	select ANON_INODES
 	select ANON_INODES
 	select HAVE_ARCH_KMEMCHECK
 	select HAVE_ARCH_KMEMCHECK
 	select HAVE_USER_RETURN_NOTIFIER
 	select HAVE_USER_RETURN_NOTIFIER

+ 1 - 2
init/Kconfig

@@ -943,8 +943,7 @@ config PERF_USE_VMALLOC
 	  See tools/perf/design.txt for details
 	  See tools/perf/design.txt for details
 
 
 config PERF_EVENTS_NMI
 config PERF_EVENTS_NMI
-	bool
-	depends on PERF_EVENTS
+	def_bool PERF_EVENTS && HAVE_PERF_EVENTS_NMI
 	help
 	help
 	  System hardware can generate an NMI using the perf event
 	  System hardware can generate an NMI using the perf event
 	  subsystem.  Also has support for calculating CPU cycle events
 	  subsystem.  Also has support for calculating CPU cycle events