diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 2e8010e6f..8ed5367ea 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -329,6 +329,7 @@ static int sysrq_use_leftctrl_sysctl_handler(struct ctl_table * table ,int write extern int sysctl_min_epoll_wait_time; extern int sysctl_clocksource_switch_unstable_cs; +extern int sysctl_clocksource_unstable_cnt; static struct ctl_table kern_table[] = { { @@ -1345,6 +1346,13 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "clocksource_unstable_cnt", + .data = &sysctl_clocksource_unstable_cnt, + .maxlen = sizeof(int), + .mode = 0444, + .proc_handler = proc_dointvec, + }, { } }; diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index a0e5a6d6c..4d67f9efd 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -37,6 +37,7 @@ #include "timekeeping_internal.h" int sysctl_clocksource_switch_unstable_cs = 0; +int sysctl_clocksource_unstable_cnt = 0; /** * clocks_calc_mult_shift - calculate mult/shift factors for scaled math of clocks @@ -231,6 +232,7 @@ static void clocksource_watchdog(unsigned long data) watchdog->name, wdnow, wdlast, watchdog->mask); pr_warn(" '%s' cs_now: %llx cs_last: %llx mask: %llx\n", cs->name, csnow, cslast, cs->mask); + sysctl_clocksource_unstable_cnt++; if (sysctl_clocksource_switch_unstable_cs) { __clocksource_unstable(cs); continue;