I would like to obtain information about interrupts assigned to my network cards. Is there any other way, than /proc/interrupts?
I would like to obtain information about interrupts assigned to my network cards. Is there any other way, than /proc/interrupts?
There are two common interfaces to kernel information ( other than syscalls ) and they are implemented as filesystems. Those two filesystems are /proc and /sys. sys is a little more organized than proc and newer, but not as user friendly. So it is a little bit better for programmers and to avoid parsing.
If you want the information from the sys filesystem (which lspci parses (see somefile that is outputted by
strace -o somefile lspci
)):Notice the 00:19 relationship between the two commands. The number returned by the irq file will be the same as first column of /proc/interrupts for the relevant device.
If you want more information on the sys filesystem look at the documentation included with the kernel source, for example the text files in
/usr/src/linux-source-2.6.27/Documentation/filesystems
Update:
Sure, if you play around with sys, you will find there are lots of symbolic links that point to other locations in sys. For example, in /sys/class/net:
So to get the irq for eth0, you can just:
lspci -v will show you which IRQ is assigned to your network card(s).
Cheers