/proc/pci文件
这个文件给出PCI设备的信息。用它可以方便地诊断PCI问题。你可以从这个文件中检索到的信息包括诸如IDE接口或USB控制器这样的设备,总线,设备和功能编号,设备延迟以及IRQ编号。
示例:
[root@localhost /]# cat /proc/pci
PCI devices found:
Bus 0, device 0, function 0:
Class 0600: PCI device 1106:3116 (rev 0).
Master Capable. Latency=8.
Prefetchable 32 bit memory at 0xe0000000 [0xe7ffffff].
Bus 0, device 1, function 0:
Class 0604: PCI device 1106:b091 (rev 0).
Master Capable. No bursts. Min Gnt=12.
Bus 0, device 16, function 2:
Class 0c03: PCI device 1106:3038 (rev 12.
IRQ 5.
Master Capable. Latency=32.
I/O at 0xec00 [0xec1f].
Bus 0, device 16, function 1:
Class 0c03: PCI device 1106:3038 (rev 12.
IRQ 3.
Master Capable. Latency=32.
I/O at 0xe800 [0xe81f].
Bus 0, device 16, function 0:
Class 0c03: PCI device 1106:3038 (rev 12.
IRQ 11.
Master Capable. Latency=32.
I/O at 0xe400 [0xe41f].
Bus 0, device 16, function 3:
Class 0c03: PCI device 1106:3104 (rev 130).
IRQ 10.
Master Capable. Latency=32.
Non-prefetchable 32 bit memory at 0xdfffff00 [0xdfffffff].
Bus 0, device 17, function 0:
Class 0601: PCI device 1106:3177 (rev 0).
Bus 0, device 17, function 1:
Class 0101: PCI device 1106:0571 (rev 6).
IRQ 255.
Master Capable. Latency=32.
I/O at 0xfc00 [0xfc0f].
Bus 0, device 17, function 5:
Class 0401: PCI device 1106:3059 (rev 80).
IRQ 5.
I/O at 0xe000 [0xe0ff].
Bus 0, device 18, function 0:
Class 0200: PCI device 1106:3065 (rev 116).
IRQ 11.
Master Capable. Latency=32. Min Gnt=3.Max Lat=8.
I/O at 0xdc00 [0xdcff].
Non-prefetchable 32 bit memory at 0xdffffe00 [0xdffffeff].
Bus 1, device 0, function 0:
Class 0300: PCI device 5333:8d04 (rev 0).
IRQ 11.
Master Capable. Latency=32. Min Gnt=4.Max Lat=255.
Non-prefetchable 32 bit memory at 0xdfe80000 [0xdfefffff].
Prefetchable 32 bit memory at 0xd0000000 [0xd7ffffff].
--------------------------------------------------------------------------------
/proc/stat文件
这个文件包含的信息有CPU利用率,磁盘,内存页,内存对换,全部中断,接触开关以及赏赐自举时间(自1970年1月1日起的秒数)。
示例:
[root@localhost /]# cat /proc/stat
cpu 31994 3898 7161 381600 15254 451 0
cpu0 31994 3898 7161 381600 15254 451 0
intr 4615930 4404290 3364 0 0 12 0 7 0 2 0 0 12618 112114 0 44142 39381
ctxt 1310498
btime 1148891913
processes 4249
procs_running 4
procs_blocked 0
--------------------------------------------------------------------------------
/proc/uptime文件
这个文件给出自从上次系统自举以来的秒数,以及其中有多少秒处于空闲。这主要供uptime程序使用。比较这两个数字能够告诉你长期来看CPU周期浪费的比例。
示例:
[root@localhost /]# cat /proc/uptime
4477.04 4021.10
--------------------------------------------------------------------------------
/proc/version文件
这个文件只有一行内容,说明正在运行的内核版本。可以用标准的编程方法进行分析获得所需的系统信息。
示例:
[root@localhost /]# cat /proc/version
Linux version 2.6.9-1.667 (
bhcompile@tweety.build.redhat.com) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Tue Nov 2 14:41:25 EST 2004
---------------------------------------------------------------------------------
参考文献:《GNU/linux编程指南》[美]Kurt Wall等著 张辉 译 SAMS 清华大学出版社
---------------------------------------------------------------------------------
续Linux中/proc目录下文件详解(三)