blob: 3514d955af949c2520aaad10307ebff15511a32d [file] [log] [blame]
Thomas Gleixner1ce60682011-02-09 20:44:21 +01001/*
2 * Debugging printout:
3 */
4
5#include <linux/kallsyms.h>
6
Paul Gortmaker9f3045e2012-04-18 16:29:57 -04007#define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f)
8#define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f)
Thomas Gleixner32f41252011-03-28 14:10:52 +02009/* FIXME */
Paul Gortmaker9f3045e2012-04-18 16:29:57 -040010#define ___PD(f) do { } while (0)
Thomas Gleixner1ce60682011-02-09 20:44:21 +010011
12static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
13{
Guenter Roeckff5544dd2017-12-02 09:13:04 -080014 static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
15
16 if (!__ratelimit(&ratelimit))
17 return;
18
Thomas Gleixner1ce60682011-02-09 20:44:21 +010019 printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
20 irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
21 printk("->handle_irq(): %p, ", desc->handle_irq);
22 print_symbol("%s\n", (unsigned long)desc->handle_irq);
23 printk("->irq_data.chip(): %p, ", desc->irq_data.chip);
24 print_symbol("%s\n", (unsigned long)desc->irq_data.chip);
25 printk("->action(): %p\n", desc->action);
26 if (desc->action) {
27 printk("->action->handler(): %p, ", desc->action->handler);
28 print_symbol("%s\n", (unsigned long)desc->action->handler);
29 }
30
Paul Gortmaker9f3045e2012-04-18 16:29:57 -040031 ___P(IRQ_LEVEL);
32 ___P(IRQ_PER_CPU);
33 ___P(IRQ_NOPROBE);
34 ___P(IRQ_NOREQUEST);
35 ___P(IRQ_NOTHREAD);
36 ___P(IRQ_NOAUTOEN);
Thomas Gleixner1ce60682011-02-09 20:44:21 +010037
Paul Gortmaker9f3045e2012-04-18 16:29:57 -040038 ___PS(IRQS_AUTODETECT);
39 ___PS(IRQS_REPLAY);
40 ___PS(IRQS_WAITING);
41 ___PS(IRQS_PENDING);
Thomas Gleixner32f41252011-03-28 14:10:52 +020042
Paul Gortmaker9f3045e2012-04-18 16:29:57 -040043 ___PD(IRQS_INPROGRESS);
44 ___PD(IRQS_DISABLED);
45 ___PD(IRQS_MASKED);
Thomas Gleixner1ce60682011-02-09 20:44:21 +010046}
47
Paul Gortmaker9f3045e2012-04-18 16:29:57 -040048#undef ___P
49#undef ___PS
50#undef ___PD