While infrequent it's better if all per CPU events have a counter. Only done for x86 currently. Cc: tglx@linutronix.de Signed-off-by: Andi Kleen <ak@suse.de> --- arch/x86/kernel/irq_32.c | 7 +++++++ arch/x86/kernel/irq_64.c | 7 +++++++ include/linux/clocksource.h | 3 +++ kernel/time/clocksource.c | 5 +++++ 4 files changed, 22 insertions(+) Index: linux/arch/x86/kernel/irq_32.c =================================================================== --- linux.orig/arch/x86/kernel/irq_32.c +++ linux/arch/x86/kernel/irq_32.c @@ -15,6 +15,7 @@ #include <linux/notifier.h> #include <linux/cpu.h> #include <linux/delay.h> +#include <linux/clocksource.h> #include <asm/apic.h> #include <asm/uaccess.h> @@ -315,6 +316,12 @@ skip: per_cpu(irq_stat,j).irq_tlb_count); seq_printf(p, " TLB shootdowns\n"); #endif +#ifdef CONFIG_CLOCKSOURCE_WATCHDOG + seq_printf(p, "CDG: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", per_cpu(clock_wdog_count,j)); + seq_printf(p, " Clocksource Watchdog checks\n"); +#endif seq_printf(p, "TRM: "); for_each_online_cpu(j) seq_printf(p, "%10u ", Index: linux/include/linux/clocksource.h =================================================================== --- linux.orig/include/linux/clocksource.h +++ linux/include/linux/clocksource.h @@ -14,6 +14,7 @@ #include <linux/list.h> #include <linux/cache.h> #include <linux/timer.h> +#include <linux/percpu.h> #include <asm/div64.h> #include <asm/io.h> @@ -232,4 +233,6 @@ static inline void update_vsyscall_tz(vo } #endif +DECLARE_PER_CPU(unsigned, clock_wdog_count); + #endif /* _LINUX_CLOCKSOURCE_H */ Index: linux/kernel/time/clocksource.c =================================================================== --- linux.orig/kernel/time/clocksource.c +++ linux/kernel/time/clocksource.c @@ -76,6 +76,8 @@ static DEFINE_SPINLOCK(watchdog_lock); static cycle_t watchdog_last; static unsigned long watchdog_resumed; +DEFINE_PER_CPU(unsigned, clock_wdog_count); + /* * Interval: 0.5sec Threshold: 0.0625s */ @@ -102,6 +104,9 @@ static void clocksource_watchdog(unsigne int64_t wd_nsec, cs_nsec; int resumed; + per_cpu(clock_wdog_count, get_cpu())++; + put_cpu(); + spin_lock(&watchdog_lock); resumed = test_and_clear_bit(0, &watchdog_resumed); Index: linux/arch/x86/kernel/irq_64.c =================================================================== --- linux.orig/arch/x86/kernel/irq_64.c +++ linux/arch/x86/kernel/irq_64.c @@ -13,6 +13,7 @@ #include <linux/seq_file.h> #include <linux/module.h> #include <linux/delay.h> +#include <linux/clocksource.h> #include <asm/uaccess.h> #include <asm/io_apic.h> #include <asm/idle.h> @@ -139,6 +140,12 @@ skip: for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->irq_thermal_count); seq_printf(p, " Thermal event interrupts\n"); +#ifdef CONFIG_CLOCKSOURCE_WATCHDOG + seq_printf(p, "CDG: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", per_cpu(clock_wdog_count,j)); + seq_printf(p, " Clocksource Watchdog checks\n"); +#endif seq_printf(p, "THR: "); for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->irq_threshold_count); --
| Kristen Carlson Accardi | [PATCH] ata: ahci: power off unused ports |
| Trent Piepho | [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Jan Engelhardt | Re: Kernel Development & Objective-C |
| Chuck Ebbert | Why do so many machines need "noapic"? |
git: | |
| Jan Engelhardt | about c8af1de9 (git status uses pager) |
| Junio C Hamano | Re: [PATCH 3/3] Teach "git branch" about --new-workdir |
| Nicolas Pitre | Re: Git tree for old kernels from before the current tree |
| Linus Torvalds | Re: cleaner/better zlib sources? |
| Nick Guenther | Re: Real men don't attack straw men |
| Predrag Punosevac | Skype on the OpenBSD |
| Karsten McMinn | Re: Packets Per Second Limit? |
| L. V. Lammert | Re: About Xen: maybe a reiterative question but .. |
| Marnix Klooster | Re: Europe Distribution |
| Sean Moss-Pultz | [openmoko-announce] Let us impact the material world |
| Kosa | Re: Car Mode Application... |
| Federico Lorenzi | Re: multi-tutch? |
| Battery Maximizer Software | 8 hours ago | Linux kernel |
| windows folder creation surprise | 9 hours ago | Windows |
| Problem in scim in Fedora 9 | 11 hours ago | Linux general |
| Firewall | 1 day ago | OpenBSD |
| IP layer send packet | 1 day ago | Linux kernel |
| dtrace for linux available | 2 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 2 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 2 days ago | NetBSD |
| vsftpd Upload Problems | 2 days ago | Linux general |
| creating con folder in desktop | 3 days ago | Windows |
