linux通过什么命令查看中断,查看linux 中断

这篇文章主要是介绍如何详细的查看linux软中断信息。

涉及linux软中断原理部分请参考:http://book.51cto.com/art/200912/168622.htm

一、利用sysstat 中的工具包mpstat

ps:图片是截取个人电脑,所以没什么压力:

16时32分48秒 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle

16时32分49秒 all 4.52 0.00 1.26 0.00 0.00 0.00 0.00 0.00 94.22

16时32分49秒 0 5.88 0.00 2.94 0.00 0.00 0.00 0.00 0.00 91.18

16时32分49秒 1 11.11 0.00 1.01 0.00 0.00 0.00 0.00 0.00 87.88

16时32分49秒 2 1.00 0.00 2.00 0.00 0.00 0.00 0.00 0.00 97.00

16时32分49秒 3 1.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 98.00

其中%irp  表示有多少中断请求发生,%soft 表示实际cpu正在处理的中断请求在生产环境中,可以保留平常时候的这些记录,在负载高的情况下,拿出来对比!

二、查看文件/proc/interrupts (这个主要是硬件中断)

文件标题为:

irp的序号  各自cpu上发生的中断次数  可编程中断控制器   设备名称(request_irq的dev_name字段)

CPU0 CPU1 CPU2 CPU3

0: 42 63 0 2 IO-APIC-edge timer

1: 752 27 3482 3 IO-APIC-edge i8042

8: 1 0 0 0 IO-APIC-edge rtc0

9: 0 4 0 0 IO-APIC-fasteoi acpi

12: 2161987 41 52 42 IO-APIC-edge i8042

14: 75884 2900 2898 2877 IO-APIC-edge ata_piix

15: 83 9438 9104 100 IO-APIC-edge ata_piix

16: 159 101 178 111 IO-APIC-fasteoi ehci_hcd:usb1, snd_hda_intel

17: 682317 17 16 22 IO-APIC-fasteoi eth1

18: 0 0 0 0 IO-APIC-fasteoi ips

19: 0 0 0 0 IO-APIC-fasteoi ata_piix

23: 34 33 28 31 IO-APIC-fasteoi ehci_hcd:usb2

44: 0 0 0 0 PCI-MSI-edge pciehp

45: 0 0 0 0 PCI-MSI-edge eth0

46: 3 4 3 3 PCI-MSI-edge mei

47: 48497 7 6 6 PCI-MSI-edge i915

48: 63 66 47 64 PCI-MSI-edge snd_hda_intel

NMI: 972 930 262 258 Non-maskable interrupts

LOC: 1092994 969807 894570 872319 Local timer interrupts

SPU: 0 0 0 0 Spurious interrupts

PMI: 972 930 262 258 Performance monitoring interrupts

IWI: 0 0 0 0 IRQ work interrupts

RES: 3557255 3651095 658468 682760 Rescheduling interrupts

CAL: 579 542 625 601 Function call interrupts

TLB: 10116 25398 8181 11007 TLB shootdowns

TRM: 0 0 0 0 Thermal event interrupts

THR: 0 0 0 0 Threshold APIC interrupts

MCE: 0 0 0 0 Machine check exceptions

MCP: 66 66 66 66 Machine check polls

ERR: 0

MIS: 0

三、查看/proc/softirqs (主要是软中断)

CPU0 CPU1 CPU2 CPU3

HI: 0 0 0 0

TIMER: 5455311 39758805 357638 451879

NET_TX: 24 15 18 5

NET_RX: 118170 1220 1370 993

BLOCK: 86329 3305 14438 2936

BLOCK_IOPOLL: 0 0 0 0

TASKLET: 877029 44 5632 23

SCHED: 344191 308721 186694 191592

HRTIMER: 4081 3910 1393 1198

RCU: 400523 362823 188456 192853

欢迎各位讨论!

实战参考地址:

http://blog.netzhou.net/?p=152

http://blog.yufeng.info/archives/2037

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值