In a program you must write a parser program to examine the
/proc/interrupt file... maybe using regular expressions (see "man
regex" and regex.h in C).
Via kernel you can use the syscall kstat_irqs(IRQ_NUMBER) and, for
other information, see irb_desc array. But unfortunally these symols
are not exported by default.

---- a little (pseudo)example:
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel_stat.h>

static int mymodule_init(void)
{
   printk(KERN_ALERT "irq%i:%i\n",
          IRQ_NUMBER,
//        irq_desc[IRQ_NUMBER].handler->typename,
          kstat_irqs(IRQ_NUMBER));
   return 0;
}
module_init(mymodule_init);
----

2008/8/17 Geert Vancompernolle <[EMAIL PROTECTED]>:
> Hi,
>
> Anyone any idea how to read out the number of interrupts for a certain IRQ
> number from /proc/interrupts, from within a program (so, not using cat
> /proc/interrupts from the command shell)?
>
> Best rgds,
>
> --Geert

Reply via email to