aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/nmi_watchdog.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/nmi_watchdog.c b/kernel/nmi_watchdog.c
index 73c1954a97bb..4f23505d887d 100644
--- a/kernel/nmi_watchdog.c
+++ b/kernel/nmi_watchdog.c
@@ -166,8 +166,12 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
166 wd_attr.sample_period = hw_nmi_get_sample_period(); 166 wd_attr.sample_period = hw_nmi_get_sample_period();
167 event = perf_event_create_kernel_counter(&wd_attr, hotcpu, -1, wd_overflow); 167 event = perf_event_create_kernel_counter(&wd_attr, hotcpu, -1, wd_overflow);
168 if (IS_ERR(event)) { 168 if (IS_ERR(event)) {
169 printk(KERN_ERR "nmi watchdog failed to create perf event on %i: %p\n", hotcpu, event); 169 wd_attr.type = PERF_TYPE_SOFTWARE;
170 return NOTIFY_BAD; 170 event = perf_event_create_kernel_counter(&wd_attr, hotcpu, -1, wd_overflow);
171 if (IS_ERR(event)) {
172 printk(KERN_ERR "nmi watchdog failed to create perf event on %i: %p\n", hotcpu, event);
173 return NOTIFY_BAD;
174 }
171 } 175 }
172 per_cpu(nmi_watchdog_ev, hotcpu) = event; 176 per_cpu(nmi_watchdog_ev, hotcpu) = event;
173 perf_event_enable(per_cpu(nmi_watchdog_ev, hotcpu)); 177 perf_event_enable(per_cpu(nmi_watchdog_ev, hotcpu));