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
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
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
can see that
/proc/interruptshas
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
相关文章推荐
- Math.floor,Math.ceil,Math.rint,Math.round用法详解
- HDU 4912 (贪心)
- Android scrollBy(x,y)和scrollTo(x,y)的区别
- FJOI省队集训 florida
- 查看binlog文件的2种方式
- I/O流学习笔记
- js学习笔记第一篇
- SDAU练习四总结
- 操作系统复习大纲
- C++ 读取 pcap文件
- mac下tomcat的配置和jdk的设置 jsp的初级知识
- SQL 中NOT EXISTS的改写
- PHP架构师的成长之路
- hive介绍与安装
- iOS-最全的App上架教程
- 堆和栈的区别(转过无数次的文章)
- 程序员——java基础之继承
- HDU 4911 (树状数组)
- hibernate的实体生命周期
- http 协议 与tcp/ip协议、Socket的区别