diff options
Diffstat (limited to 'kernel/watchdog.c')
| -rw-r--r-- | kernel/watchdog.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 3d0c56ad4792..36491cd5b7d4 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
| @@ -200,6 +200,7 @@ static int is_softlockup(unsigned long touch_ts) | |||
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | #ifdef CONFIG_HARDLOCKUP_DETECTOR | 202 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
| 203 | |||
| 203 | static struct perf_event_attr wd_hw_attr = { | 204 | static struct perf_event_attr wd_hw_attr = { |
| 204 | .type = PERF_TYPE_HARDWARE, | 205 | .type = PERF_TYPE_HARDWARE, |
| 205 | .config = PERF_COUNT_HW_CPU_CYCLES, | 206 | .config = PERF_COUNT_HW_CPU_CYCLES, |
| @@ -209,7 +210,7 @@ static struct perf_event_attr wd_hw_attr = { | |||
| 209 | }; | 210 | }; |
| 210 | 211 | ||
| 211 | /* Callback function for perf event subsystem */ | 212 | /* Callback function for perf event subsystem */ |
| 212 | static void watchdog_overflow_callback(struct perf_event *event, int nmi, | 213 | static void watchdog_overflow_callback(struct perf_event *event, |
| 213 | struct perf_sample_data *data, | 214 | struct perf_sample_data *data, |
| 214 | struct pt_regs *regs) | 215 | struct pt_regs *regs) |
| 215 | { | 216 | { |
| @@ -368,10 +369,11 @@ static int watchdog_nmi_enable(int cpu) | |||
| 368 | if (event != NULL) | 369 | if (event != NULL) |
| 369 | goto out_enable; | 370 | goto out_enable; |
| 370 | 371 | ||
| 371 | /* Try to register using hardware perf events */ | ||
| 372 | wd_attr = &wd_hw_attr; | 372 | wd_attr = &wd_hw_attr; |
| 373 | wd_attr->sample_period = hw_nmi_get_sample_period(watchdog_thresh); | 373 | wd_attr->sample_period = hw_nmi_get_sample_period(watchdog_thresh); |
| 374 | event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback); | 374 | |
| 375 | /* Try to register using hardware perf events */ | ||
| 376 | event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback, NULL); | ||
| 375 | if (!IS_ERR(event)) { | 377 | if (!IS_ERR(event)) { |
| 376 | printk(KERN_INFO "NMI watchdog enabled, takes one hw-pmu counter.\n"); | 378 | printk(KERN_INFO "NMI watchdog enabled, takes one hw-pmu counter.\n"); |
| 377 | goto out_save; | 379 | goto out_save; |
