您的位置:首页 > 其它

How /proc/interrupts gets updated?

2016-07-07 22:55 239 查看
As you can see in the source of the kernel, it displays all possible irqs of the system. In source/fs/proc/interrupts.c we
can see that 
/proc/interrupts
 has
as many lines as interrupts exist in the system. In source/kernel/irq/proc.c we
can see that the counters of every interrupt gets extracted from global counters via 
kstat_irqs_cpu(irq,
cpu)
. So the information gets updated in different counters, one for each cpu and the get summed upon reading the proc file.
More info about per-cpu variables you can read here.
More about interrupts in linux you can get here.(get
from http://stackoverflow.com/questions/15217793/how-proc-interrupts-gets-updated)
通过该函数得到,特定CPU上irq中断触发的中断数(*kstat_irqs)



kstat_irqs是中断irq描述符中定义的percpu的指针变量,表示中断特定irq触发的次数



当在控制台中执行"cat /proc/interrupts"时,将执行lfs_linux\kernel\irq\proc.c:show_interrupts函数



root@lrc:~# cat /proc/interrupts 

           CPU0       CPU1       CPU2       CPU3       

 29:          0          0               0             0          GIC  arch_timer

 30:       7294       6561       6554          6547      GIC  arch_timer

 56:          0           0             0              0          GIC  a15-l1l2-ecc-err-irq

 80:       7219         0             0              0          GIC  hwqueue-8704

 86:         48          0             0              0          GIC  hwqueue-8710
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: