aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irq_32.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-10-16 05:32:24 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:53:29 -0400
commit6b39ba771e3c78d00e0abcebad270bd4212b28bc (patch)
tree98c0b1598eff3882faaef3b0f2ee72dcbe2f0ea0 /arch/x86/kernel/irq_32.c
parentc0c168ca26b54a4a6ad34fc813fe00f275fbc94c (diff)
x86: unify show_interrupts() and proc helpers
show_interrupts() and proc helpers are basically the same for 32 and 64 bit. Move them to a shared source file. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/irq_32.c')
-rw-r--r--arch/x86/kernel/irq_32.c146
1 files changed, 0 insertions, 146 deletions
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 8d525765a6c4..6d9bf3936c78 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -253,152 +253,6 @@ unsigned int do_IRQ(struct pt_regs *regs)
253 return 1; 253 return 1;
254} 254}
255 255
256/*
257 * Interrupt statistics:
258 */
259
260atomic_t irq_err_count;
261
262/*
263 * /proc/interrupts printing:
264 */
265
266static int show_other_interrupts(struct seq_file *p)
267{
268 int j;
269
270 seq_printf(p, "NMI: ");
271 for_each_online_cpu(j)
272 seq_printf(p, "%10u ", nmi_count(j));
273 seq_printf(p, " Non-maskable interrupts\n");
274#ifdef CONFIG_X86_LOCAL_APIC
275 seq_printf(p, "LOC: ");
276 for_each_online_cpu(j)
277 seq_printf(p, "%10u ", per_cpu(irq_stat,j).apic_timer_irqs);
278 seq_printf(p, " Local timer interrupts\n");
279#endif
280#ifdef CONFIG_SMP
281 seq_printf(p, "RES: ");
282 for_each_online_cpu(j)
283 seq_printf(p, "%10u ", per_cpu(irq_stat,j).irq_resched_count);
284 seq_printf(p, " Rescheduling interrupts\n");
285 seq_printf(p, "CAL: ");
286 for_each_online_cpu(j)
287 seq_printf(p, "%10u ", per_cpu(irq_stat,j).irq_call_count);
288 seq_printf(p, " Function call interrupts\n");
289 seq_printf(p, "TLB: ");
290 for_each_online_cpu(j)
291 seq_printf(p, "%10u ", per_cpu(irq_stat,j).irq_tlb_count);
292 seq_printf(p, " TLB shootdowns\n");
293#endif
294#ifdef CONFIG_X86_MCE
295 seq_printf(p, "TRM: ");
296 for_each_online_cpu(j)
297 seq_printf(p, "%10u ", per_cpu(irq_stat,j).irq_thermal_count);
298 seq_printf(p, " Thermal event interrupts\n");
299#endif
300#ifdef CONFIG_X86_LOCAL_APIC
301 seq_printf(p, "SPU: ");
302 for_each_online_cpu(j)
303 seq_printf(p, "%10u ", per_cpu(irq_stat,j).irq_spurious_count);
304 seq_printf(p, " Spurious interrupts\n");
305#endif
306 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
307#if defined(CONFIG_X86_IO_APIC)
308 seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
309#endif
310 return 0;
311}
312
313int show_interrupts(struct seq_file *p, void *v)
314{
315 unsigned long flags, any_count = 0;
316 int i = *(loff_t *) v, j;
317 struct irqaction *action;
318 struct irq_desc *desc;
319
320 if (i > nr_irqs)
321 return 0;
322
323 if (i == nr_irqs)
324 return show_other_interrupts(p);
325
326 /* print header */
327 if (i == 0) {
328 seq_printf(p, " ");
329 for_each_online_cpu(j)
330 seq_printf(p, "CPU%-8d",j);
331 seq_putc(p, '\n');
332 }
333
334 desc = irq_to_desc(i);
335 spin_lock_irqsave(&desc->lock, flags);
336#ifndef CONFIG_SMP
337 any_count = kstat_irqs(i);
338#else
339 for_each_online_cpu(j)
340 any_count |= kstat_irqs_cpu(i, j);
341#endif
342 action = desc->action;
343 if (!action && !any_count)
344 goto out;
345
346 seq_printf(p, "%3d: ", i);
347#ifndef CONFIG_SMP
348 seq_printf(p, "%10u ", kstat_irqs(i));
349#else
350 for_each_online_cpu(j)
351 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
352#endif
353 seq_printf(p, " %8s", desc->chip->name);
354 seq_printf(p, "-%-8s", desc->name);
355
356 if (action) {
357 seq_printf(p, " %s", action->name);
358 while ((action = action->next) != NULL)
359 seq_printf(p, ", %s", action->name);
360 }
361
362 seq_putc(p, '\n');
363out:
364 spin_unlock_irqrestore(&desc->lock, flags);
365 return 0;
366}
367
368/*
369 * /proc/stat helpers
370 */
371u64 arch_irq_stat_cpu(unsigned int cpu)
372{
373 u64 sum = nmi_count(cpu);
374
375#ifdef CONFIG_X86_LOCAL_APIC
376 sum += per_cpu(irq_stat, cpu).apic_timer_irqs;
377#endif
378#ifdef CONFIG_SMP
379 sum += per_cpu(irq_stat, cpu).irq_resched_count;
380 sum += per_cpu(irq_stat, cpu).irq_call_count;
381 sum += per_cpu(irq_stat, cpu).irq_tlb_count;
382#endif
383#ifdef CONFIG_X86_MCE
384 sum += per_cpu(irq_stat, cpu).irq_thermal_count;
385#endif
386#ifdef CONFIG_X86_LOCAL_APIC
387 sum += per_cpu(irq_stat, cpu).irq_spurious_count;
388#endif
389 return sum;
390}
391
392u64 arch_irq_stat(void)
393{
394 u64 sum = atomic_read(&irq_err_count);
395
396#ifdef CONFIG_X86_IO_APIC
397 sum += atomic_read(&irq_mis_count);
398#endif
399 return sum;
400}
401
402#ifdef CONFIG_HOTPLUG_CPU 256#ifdef CONFIG_HOTPLUG_CPU
403#include <mach_apic.h> 257#include <mach_apic.h>
404 258