tickless idle cpus: decrementer statistics - NOT MEANT FOR INCLUSION
Subsystems (2)
PATCH 4/4 tickless idle cpus: decrementer statistics - NOT MEANT FOR INCLUSION
This patch (a hack) provides some statistics of decrementer exception on each CPU. I used this purely to verify that tickless feature is working.
Anton, would this be useful statistics to be exposed (maybe in /proc/interrupts)? If so, I could work out a more cleaner way of providing this statistics to user.
Signed-off-by Srivatsa Vaddagiri <[email protected]>
---
linux-2.6.17-rc1-root/arch/powerpc/kernel/time.c | 4 ++++ linux-2.6.17-rc1-root/fs/proc/proc_misc.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+)
arch/powerpc/kernel/time.c renamed from arch/powerpc/kernel/time.c~stat +4 -0
@@ -757,6 +757,8 @@ void start_hz_timer(struct pt_regs *regsstatic inline int clear_hzless_mask (void ) {return 0 ;}#endif +DEFINE_PER_CPU (int, dec_ticks); +/* * For iSeries shared processors, we have to let the hypervisor * set the hardware decrementer. We set a virtual decrementer
@@ -780,6 +782,8 @@ void timer_interrupt(struct pt_regs * reirq_enter (); +__get_cpu_var (dec_ticks) +=1 ; +clear_hzless_mask ();profile_tick (CPU_PROFILING , regs);
fs/proc/proc_misc.c renamed from fs/proc/proc_misc.c~stat +17 -0
@@ -243,6 +243,22 @@ static int version_read_proc(char *page,return proc_calc_metrics (page, start, off, count, eof, len); } +DECLARE_PER_CPU (int, dec_ticks); + +static int decrementer_read_proc (char *page,char **start,off_t off, +int count,int *eof,void *data) +{ +int len, cpu; +char *cp = page; + +for_each_cpu (cpu) + cp +=sprintf (cp,"%d " ,per_cpu (dec_ticks, cpu)); + + len = cp - page; + +return proc_calc_metrics (page, start, off, count, eof, len); +} +extern struct seq_operations cpuinfo_op;static int cpuinfo_open (struct inode *inode,struct file *file) {
@@ -740,6 +756,7 @@ void __init proc_misc_init(void) {"uptime", uptime_read_proc}, {"meminfo", meminfo_read_proc}, {"version", version_read_proc}, + {"decrementer", decrementer_read_proc}, #ifdef CONFIG_PROC_HARDWARE {"hardware", hardware_read_proc}, #endif
_
Signature · 2 lines
Regards, vatsa