Linux根目录下的/proc是系统的虚拟文件系统。其结构如下:
/proc ----1/
|---2/
|...(一系列以进程PID命名的文件夹)
|---bus/ 该文件夹下存放总线设备
|---driver/
|---fs/
|---irq/
|---net/
|---scsi/
|---sys/
|---sysvipc/
|---tty/
|
|---一些系统文件
/proc/N目录
该系列目录存放对应PID的进程信息
# cat /proc/1/cmdline
init#
/proc/N/cwd 链接到进程当前工作目录
/proc/N/environ 进程环境变量列表
# cat /proc/1/environ
HOME=/TERM=linux#
//不可查看
/proc/N/fd 包含进程相关的所有的文件描述符
/proc/N/maps 与进程相关的内存映射信息
[root@F12 ~]# cat /proc/1/maps
0047e000-0049c000 r-xp 00000000 fd:00 226878 /lib/ld-2.11.2.so
0049c000-0049d000 r--p 0001d000 fd:00 226878 /lib/ld-2.11.2.so
0049d000-0049e000 rw-p 0001e000 fd:00 226878 /lib/ld-2.11.2.so
004a0000-00612000 r-xp 00000000 fd:00 226879 /lib/libc-2.11.2.so
00612000-00613000 ---p 00172000 fd:00 226879 /lib/libc-2.11.2.so
00613000-00615000 r--p 00172000 fd:00 226879 /lib/libc-2.11.2.so
00615000-00616000 rw-p 00174000 fd:00 226879 /lib/libc-2.11.2.so
00616000-00619000 rw-p 00000000 00:00 0
00fd9000-00fda000 r-xp 00000000 00:00 0 [vdso]
08048000-08069000 r-xp 00000000 fd:00 138093 /sbin/init
08069000-0806b000 rw-p 00020000 fd:00 138093 /sbin/init
089f3000-08a1e000 rw-p 00000000 00:00 0 [heap]
b78a5000-b78a6000 rw-p 00000000 00:00 0
b78c5000-b78c6000 rw-p 00000000 00:00 0
bfd94000-bfda9000 rw-p 00000000 00:00 0 [stack]
/proc/N/mem 指代进程持有的内存,不可读
/proc/N/root 链接到进程的根目录
/proc/N/stat 进程的状态
# cat /proc/1/stat
1 (init) S 0 1 1 0 -1 4194560 111 6470671 0 0 0 561 19557 17854 20 0 1 0 10 2035712 89 2147483647 4194304 4677084 2144513120 2144512032 722244372 0 0 0 25280519 2147745052 0 0 0 0 0 0 0 0 0
# cat /proc/1/statm
497 89 73 118 0 252 0
# cat /proc/1/status
Name: init
State: S (sleeping)
Tgid: 1
Pid: 1
PPid: 0
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 32
Groups:
VmPeak: 1988 kB
VmSize: 1988 kB
VmLck: 0 kB
VmHWM: 356 kB
VmRSS: 356 kB
VmData: 872 kB
VmStk: 136 kB
VmExe: 472 kB
VmLib: 476 kB
VmPTE: 16 kB
VmSwap: 0 kB
Threads: 1
SigQ: 0/435
SigPnd: 00000000000000000000000000000000
ShdPnd: 00000000000000000000000000000000
SigBlk: 00000000000000000000000000000000
SigIgn: 00000000000000000000000000000000
SigCgt: 0000000000000000000000000181c007
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: fffffffffffffeff
CapBnd: ffffffffffffffff
Cpus_allowed: 1
Cpus_allowed_list: 0
voluntary_ctxt_switches: 62
nonvoluntary_ctxt_switches: 2
/proc/bus目录
该目录存放一些系统总线相关信息,如:pic、usb设备
/proc/driver目录
该目录存放设备驱动,如rtc
/proc/fs目录
文件系统信息
/proc/irq目录
中断请求设备信息
/proc/net目录
网络设备
/proc/net/dev
显示网络适配器及统计信息
/proc/scsi目录
scsi设备信息
/proc/tty目录
tty设备信息
/proc/buddyinfo
每个内存区中的每个order有多少块可用,和内存碎片问题有关
[root@F12 ~]# cat /proc/buddyinfo
Node 0, zone DMA 21 16 20 15 8 0 0 0 0 1 0
Node 0, zone Normal 4244 4360 120 3 3 1 1 1 1 0 0
Node 0, zone HighMem 417 3 1 3 2 0 0 0 0 0 0
/proc/cmdline
启动时传递给kernel的参数信息
[root@F12 ~]# cat /proc/cmdline
ro root=/dev/mapper/vg_f12-lv_root nomodeset LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
# cat /proc/cmdline
console=ttyS1,57600n8 root=/dev/ram0 console=ttyS0
/proc/cpuinfo
cpu的信息
# cat /proc/cpuinfo
system type : MT7620
processor : 0
cpu model : MIPS 24Kc V5.0
BogoMIPS : 386.04
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0004, 0x0a1c, 0x0ff8, 0x0973]
ASEs implemented : mips16 dsp
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
/proc/crypto
内核使用的所有已安装的加密密码及细节
[root@F12 ~]# cat /proc/crypto
name : stdrng
driver : krng
module : kernel
priority : 200
refcnt : 1
selftest : passed
type : rng
seedsize : 0
name : crc32c
driver : crc32c-generic
module : kernel
priority : 100
refcnt : 1
selftest : passed
type : shash
blocksize : 1
digestsize : 4
descsize : 4
name : sha1
driver : sha1-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 20
descsize : 92
name : md5
driver : md5-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
type : shash
blocksize : 64
digestsize : 16
descsize : 88
/proc/devices
已经加载的设备并分类
[root@F12 ~]# cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
81 video4linux
99 ppdev
128 ptm
136 pts
162 raw
180 usb
189 usb_device
202 cpu/msr
203 cpu/cpuid
250 hidraw
251 usbmon
252 bsg
253 pcmcia
254 rtc
Block devices:
1 ramdisk
2 fd
259 blkext
7 loop
8 sd
9 md
11 sr
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
253 device-mapper
254 mdp
/proc/dma
已注册使用的ISA DMA频道列表
[root@F12 ~]# cat /proc/dma
2: floppy
4: cascade
/proc/execdomains
Linux内核当前支持的execution domains
[root@F12 ~]# cat /proc/execdomains
0-0 Linux [kernel]
/proc/fb
帧缓冲设备列表,包括数量和控制它的驱动
/proc/filesystems
内核当前支持的文件系统类型
[root@F12 ~]# cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cgroup
nodev cpuset
nodev binfmt_misc
nodev debugfs
nodev securityfs
nodev sockfs
nodev usbfs
nodev pipefs
nodev anon_inodefs
nodev tmpfs
nodev inotifyfs
nodev devpts
ext3
ext4
ext4dev
nodev ramfs
nodev hugetlbfs
iso9660
nodev mqueue
nodev selinuxfs
nodev vmhgfs
nodev fuse
fuseblk
nodev fusectl
nodev rpc_pipefs
nodev nfsd
/proc/interrupts
x86架构中的每个IRQ中断数
[root@F12 ~]# cat /proc/interrupts
CPU0 CPU1
0: 2523 0 IO-APIC-edge timer
1: 9 59587 IO-APIC-edge i8042
3: 0 1 IO-APIC-edge
4: 1 0 IO-APIC-edge
6: 2 3 IO-APIC-edge floppy
7: 0 0 IO-APIC-edge parport0
8: 1 0 IO-APIC-edge rtc0
9: 0 0 IO-APIC-fasteoi acpi
12: 101 414159 IO-APIC-edge i8042
14: 0 0 IO-APIC-edge ata_piix
15: 2052469 3722477 IO-APIC-edge ata_piix
16: 0 0 IO-APIC-fasteoi ehci_hcd:usb1
17: 663267 137 IO-APIC-fasteoi ioc0
18: 60 6412 IO-APIC-fasteoi uhci_hcd:usb2
19: 6 1132951 IO-APIC-fasteoi eth7
24: 0 0 PCI-MSI-edge pciehp
25: 0 0 PCI-MSI-edge pciehp
26: 0 0 PCI-MSI-edge pciehp
27: 0 0 PCI-MSI-edge pciehp
28: 0 0 PCI-MSI-edge pciehp
29: 0 0 PCI-MSI-edge pciehp
30: 0 0 PCI-MSI-edge pciehp
31: 0 0 PCI-MSI-edge pciehp
32: 0 0 PCI-MSI-edge pciehp
33: 0 0 PCI-MSI-edge pciehp
34: 0 0 PCI-MSI-edge pciehp
35: 0 0 PCI-MSI-edge pciehp
36: 0 0 PCI-MSI-edge pciehp
37: 0 0 PCI-MSI-edge pciehp
38: 0 0 PCI-MSI-edge pciehp
39: 0 0 PCI-MSI-edge pciehp
40: 0 0 PCI-MSI-edge pciehp
41: 0 0 PCI-MSI-edge pciehp
42: 0 0 PCI-MSI-edge pciehp
43: 0 0 PCI-MSI-edge pciehp
44: 0 0 PCI-MSI-edge pciehp
45: 0 0 PCI-MSI-edge pciehp
46: 0 0 PCI-MSI-edge pciehp
47: 0 0 PCI-MSI-edge pciehp
48: 0 0 PCI-MSI-edge pciehp
49: 0 0 PCI-MSI-edge pciehp
50: 0 0 PCI-MSI-edge pciehp
51: 0 0 PCI-MSI-edge pciehp
52: 0 0 PCI-MSI-edge pciehp
53: 0 0 PCI-MSI-edge pciehp
54: 0 0 PCI-MSI-edge pciehp
55: 0 0 PCI-MSI-edge pciehp
56: 3 0 PCI-MSI-edge vmci
57: 0 0 PCI-MSI-edge vmci
NMI: 0 0 Non-maskable interrupts
LOC: 28580837 13167838 Local timer interrupts
SPU: 0 0 Spurious interrupts
CNT: 0 0 Performance counter interrupts
PND: 0 0 Performance pending work
RES: 1661910 3545173 Rescheduling interrupts
CAL: 130 198 Function call interrupts
TLB: 71869 54124 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 2338 2338 Machine check polls
ERR: 0
MIS: 0
/proc/iomem
每个物理设备当前在系统内存中的映射
# cat /proc/iomem
00000000-03ffffff : System RAM
00000000-004c5ff3 : Kernel code
004c5ff4-005bceff : Kernel data
101c0000-101c0fff : rt3xxx-ehci
101c0000-101c0fff : ehci_hcd
101c1000-101c1fff : rt3xxx-ohci
101c1000-101c1fff : ohci_hcd
20000000-2fffffff : PCI MEM1
20000000-200fffff : PCI Bus 0000:01
20000000-200fffff : 0000:01:00.0
20100000-201fffff : PCI Bus 0000:01
20100000-2010ffff : 0000:01:00.0
20200000-2020ffff : 0000:00:00.0
b0130000-b0133fff : mtk-sd.0
b0130000-b0133fff : mtk-sd
/proc/ioports
一个设备的输入输出所使用的注册端口范围
[root@F12 t11]# cat /proc/ioports
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-0060 : keyboard
0064-0064 : keyboard
0070-0071 : rtc0
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : 0000:00:07.1
0170-0177 : ata_piix
01f0-01f7 : 0000:00:07.1
01f0-01f7 : ata_piix
02f8-02ff : serial
0376-0376 : 0000:00:07.1
0376-0376 : ata_piix
0378-037a : parport0
03c0-03df : vga+
03f2-03f2 : floppy
03f4-03f5 : floppy
03f6-03f6 : 0000:00:07.1
03f6-03f6 : ata_piix
03f7-03f7 : floppy
03f8-03ff : serial
0cf0-0cf1 : pnp 00:01
0cf8-0cff : PCI conf1
1000-103f : 0000:00:07.3
1000-103f : pnp 00:01
1000-1003 : ACPI PM1a_EVT_BLK
1004-1005 : ACPI PM1a_CNT_BLK
1008-100b : ACPI PM_TMR
100c-100f : ACPI GPE0_BLK
1010-1015 : ACPI CPU throttle
1040-104f : 0000:00:07.3
1040-104f : pnp 00:01
1060-106f : 0000:00:07.1
1060-106f : ata_piix
1070-107f : 0000:00:0f.0
1080-10bf : 0000:00:07.7
1080-10bf : vmci
1400-14ff : 0000:00:10.0
2000-3fff : PCI Bus 0000:02
2000-207f : 0000:02:01.0
2000-2063 : vmxnet ether
2080-209f : 0000:02:00.0
2080-209f : uhci_hcd
4000-4fff : PCI Bus 0000:03
5000-5fff : PCI Bus 0000:0b
6000-6fff : PCI Bus 0000:13
7000-7fff : PCI Bus 0000:1b
8000-8fff : PCI Bus 0000:04
9000-9fff : PCI Bus 0000:0c
a000-afff : PCI Bus 0000:14
b000-bfff : PCI Bus 0000:1c
c000-cfff : PCI Bus 0000:05
d000-dfff : PCI Bus 0000:0d
e000-efff : PCI Bus 0000:15
fce0-fcff : pnp 00:0d
/proc/kcore
代表系统的物理内存,存储为核心文件格式,里边显示的是字节数,等于RAM大小加上4kb
/proc/kmsg
记录内核生成的信息,可以通过/sbin/klogd或/bin/dmesg来处理
/proc/loadavg
根据过去一段时间内CPU和IO的状态得出的负载状态,与uptime命令有关
[root@F12 t11]# cat /proc/loadavg
0.00 0.00 0.00 2/272 32516
/proc/locks
内核锁住的文件列表
[root@F12 t11]# cat /proc/locks
1: POSIX ADVISORY WRITE 31359 fd:00:206094 0 EOF
2: POSIX ADVISORY WRITE 31357 fd:00:206093 0 EOF
3: POSIX ADVISORY READ 26544 fd:00:201571 4 4
4: POSIX ADVISORY READ 26544 fd:00:201340 4 4
5: POSIX ADVISORY WRITE 15874 fd:00:206363 0 EOF
6: POSIX ADVISORY WRITE 15874 fd:00:206362 0 EOF
7: POSIX ADVISORY WRITE 15874 fd:00:206345 0 EOF
8: POSIX ADVISORY READ 1751 fd:00:201340 4 4
9: POSIX ADVISORY WRITE 1741 fd:00:133258 0 EOF
10: POSIX ADVISORY READ 1719 fd:00:201552 4 4
11: POSIX ADVISORY READ 1719 fd:00:201551 4 4
12: POSIX ADVISORY READ 1719 fd:00:201550 4 4
13: POSIX ADVISORY READ 1719 fd:00:201549 4 4
14: POSIX ADVISORY READ 1719 fd:00:201340 4 4
15: POSIX ADVISORY WRITE 1719 fd:00:206101 0 0
16: POSIX ADVISORY WRITE 1596 fd:00:206095 0 EOF
17: FLOCK ADVISORY WRITE 1209 fd:00:133492 0 EOF
18: FLOCK ADVISORY WRITE 1093 fd:00:132755 0 EOF
/proc/mdstat
多硬盘,RAID配置信息(md=multiple disks)
[root@F12 t11]# cat /proc/mdstat
Personalities :
unused devices: <none>
/proc/meminfo
RAM使用的相关信息
[root@F12 t11]# cat /proc/meminfo
MemTotal: 1027080 kB
MemFree: 56404 kB
Buffers: 240168 kB
Cached: 413020 kB
SwapCached: 1836 kB
Active: 457168 kB
Inactive: 328708 kB
Active(anon): 12500 kB
Inactive(anon): 124352 kB
Active(file): 444668 kB
Inactive(file): 204356 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 141256 kB
HighFree: 672 kB
LowTotal: 885824 kB
LowFree: 55732 kB
SwapTotal: 2621432 kB
SwapFree: 2604048 kB
Dirty: 8 kB
Writeback: 0 kB
AnonPages: 131308 kB
Mapped: 42752 kB
Slab: 164156 kB
SReclaimable: 139156 kB
SUnreclaim: 25000 kB
PageTables: 7284 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 3134972 kB
Committed_AS: 801660 kB
VmallocTotal: 122880 kB
VmallocUsed: 3488 kB
VmallocChunk: 110284 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 10232 kB
DirectMap2M: 897024 kB
/proc/misc
其他的主要设备(设备号为10)上注册的驱动
[root@F12 t11]# cat /proc/misc
229 fuse
57 vsock
223 uinput
58 vmci
59 network_throughput
60 network_latency
61 cpu_dma_latency
62 device-mapper
175 agpgart
144 nvram
228 hpet
231 snapshot
227 mcelog
63 vga_arbiter
/proc/modules
所有加载到内核的模块列表
[root@F12 t11]# cat /proc/modules
gspca_zc3xx 44648 0 - Live 0xf7eff000
gspca_main 19556 1 gspca_zc3xx, Live 0xf7ee9000
videodev 30160 1 gspca_main, Live 0xf7e78000
v4l1_compat 12312 1 videodev, Live 0xf7e68000
ipt_MASQUERADE 2788 1 - Live 0xf8a49000
iptable_nat 6068 1 - Live 0xf8a3b000
nf_nat 18008 2 ipt_MASQUERADE,iptable_nat, Live 0xf8a2c000
bridge 43992 0 - Live 0xf89c3000
stp 1988 1 bridge, Live 0xf89af000
llc 4960 2 bridge,stp, Live 0xf89a5000
nfsd 209700 1 - Live 0xf8968000
lockd 59892 1 nfsd, Live 0xf891c000
nfs_acl 2488 1 nfsd, Live 0xf8904000
auth_rpcgss 31160 1 nfsd, Live 0xf88f4000
exportfs 3736 1 nfsd, Live 0xf88e6000
sunrpc 158388 5 nfsd,lockd,nfs_acl,auth_rpcgss, Live 0xf88b6000
ipv6 239428 28 - Live 0xf8824000
fuse 52712 4 - Live 0xf87ad000
vmhgfs 43276 1 - Live 0xf878d000
vsock 37540 0 - Live 0xf85f1000
vmmemctl 10896 0 - Live 0xf84cb000
dm_multipath 14472 0 - Live 0xf7e72000
uinput 6852 0 - Live 0xf7e55000
ppdev 8200 0 - Live 0xf7e39000
vmci 63396 2 vmhgfs,vsock, Live 0xf82b8000
parport_pc 22748 0 - Live 0xf8176000
parport 29300 2 ppdev,parport_pc, Live 0xf815e000
i2c_piix4 11968 0 - Live 0xf814a000
i2c_core 23160 2 videodev,i2c_piix4, Live 0xf8138000
vmxnet 16620 0 - Live 0xf7ee2000
mptspi 15640 2 - Live 0xf7eb7000
mptscsih 26692 1 mptspi, Live 0xf7eae000
mptbase 71816 2 mptspi,mptscsih, Live 0xf7e83000
scsi_transport_spi 19500 1 mptspi, Live 0xf7e61000
floppy 47700 0 - Live 0xf7e47000
/proc/mounts
系统中使用的所有挂载
# cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,relatime 0 0
none /var ramfs rw,relatime 0 0
none /dev ramfs rw,relatime 0 0
none /etc ramfs rw,relatime 0 0
none /tmp ramfs rw,relatime 0 0
none /media ramfs rw,relatime 0 0
none /sys sysfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
mdev /dev ramfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
/dev/mmcblk0p1 /media/mmcblk0p1 fuseblk rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
/dev/mmcblk0p1 /etc_ro/lighttpd/www/avres fuseblk rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
/proc/mtrr
系统使用的Memory Type Range Registers (MTRRs)
[root@F12 t11]# cat /proc/mtrr
reg00: base=0x000000000 ( 0MB), size= 1024MB, count=1: write-back
/proc/partitions
分区中的块分配信息
[root@F12 t11]# cat /proc/partitions
major minor #blocks name
8 0 134217728 sda
8 1 204800 sda1
8 2 134010211 sda2
253 0 131387392 dm-0
253 1 2621440 dm-1
/proc/pci
系统中的PCI设备列表
/proc/slabinfo
系统中所有活动的 slab 缓存信息
# cat /proc/slabinfo
slabinfo - version: 2.1
# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
bridge_fdb_cache 3 113 32 113 1 : tunables 120 60 0 : slabdata 1 1 0
fib6_nodes 16 113 32 113 1 : tunables 120 60 0 : slabdata 1 1 0
ip6_dst_cache 20 30 256 15 1 : tunables 120 60 0 : slabdata 2 2 0
ndisc_cache 5 24 160 24 1 : tunables 120 60 0 : slabdata 1 1 0
RAWv6 4 6 640 6 1 : tunables 54 27 0 : slabdata 1 1 0
...
/proc/stat
所有的CPU活动信息
# cat /proc/stat
cpu 73845 0 114281 51302017 8 0 100151 0 0 0
cpu0 73845 0 114281 51302017 8 0 100151 0 0 0
intr 180814944 0 0 0 1018318 50103427 128966359 0 0 0 0 0 0 726488 0 198 0 0 153 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 9002115
btime 0
processes 412041
procs_running 1
procs_blocked 0
softirq 178599504 45918244 128965137 169327 1416824 0 0 709525 0 0 1420447
/proc/sysrq-trigger
使用echo命令来写这个文件的时候,远程root用户可以执行大多数的系统请求关键命令,就好像在本地终端执行一样。要写入这个文件,需要把/proc/sys/kernel/sysrq不能设置为0。这个文件对root也是不可读的
/proc/uptime
系统已经运行了多久
[root@F12 t11]# cat /proc/uptime
708666.58 1377324.62
/proc/swaps
交换空间的使用情况
[root@F12 t11]# cat /proc/swaps
Filename Type Size Used Priority
/dev/mapper/vg_f12-lv_swap partition 2621432 17384 -1
/proc/version
Linux内核版本和gcc版本
[root@F12 t11]# cat /proc/version
Linux version 2.6.31.5-127.fc12.i686.PAE (mockbuild@x86-3.fedora.phx.redhat.com) (gcc version 4.4.2 20091027 (Red Hat 4.4.2-7) (GCC) ) #1 SMP Sat Nov 7 21:25:57 EST 2009
# cat /proc/version
Linux version 2.6.36 (root@F12) (gcc version 3.4.2) #25 Wed Dec 30 15:01:16 CST 2015
/proc/ide
ide设备信息
/proc/vmstat
虚拟内存统计信息
# cat /proc/vmstat
nr_free_pages 6646
nr_inactive_anon 0
nr_active_anon 458
nr_inactive_file 3165
nr_active_file 1151
nr_unevictable 0
nr_mlock 0
nr_anon_pages 464
nr_mapped 314
nr_file_pages 4316
nr_dirty 0
nr_writeback 0
nr_slab_reclaimable 1135
nr_slab_unreclaimable 1658
nr_page_table_pages 65
nr_kernel_stack 40
nr_unstable 0
nr_bounce 0
nr_vmscan_write 0
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 0
/proc/vmcore
内核panic时的内存映像
/proc/diskstats
取得磁盘信息
[root@F12 ~]# cat /proc/diskstats
1 0 ram0 0 0 0 0 0 0 0 0 0 0 0
1 1 ram1 0 0 0 0 0 0 0 0 0 0 0
1 2 ram2 0 0 0 0 0 0 0 0 0 0 0
1 3 ram3 0 0 0 0 0 0 0 0 0 0 0
1 4 ram4 0 0 0 0 0 0 0 0 0 0 0
1 5 ram5 0 0 0 0 0 0 0 0 0 0 0
1 6 ram6 0 0 0 0 0 0 0 0 0 0 0
1 7 ram7 0 0 0 0 0 0 0 0 0 0 0
1 8 ram8 0 0 0 0 0 0 0 0 0 0 0
1 9 ram9 0 0 0 0 0 0 0 0 0 0 0
1 10 ram10 0 0 0 0 0 0 0 0 0 0 0
1 11 ram11 0 0 0 0 0 0 0 0 0 0 0
1 12 ram12 0 0 0 0 0 0 0 0 0 0 0
1 13 ram13 0 0 0 0 0 0 0 0 0 0 0
1 14 ram14 0 0 0 0 0 0 0 0 0 0 0
1 15 ram15 0 0 0 0 0 0 0 0 0 0 0
7 0 loop0 0 0 0 0 0 0 0 0 0 0 0
7 1 loop1 0 0 0 0 0 0 0 0 0 0 0
7 2 loop2 0 0 0 0 0 0 0 0 0 0 0
7 3 loop3 0 0 0 0 0 0 0 0 0 0 0
7 4 loop4 0 0 0 0 0 0 0 0 0 0 0
7 5 loop5 0 0 0 0 0 0 0 0 0 0 0
7 6 loop6 0 0 0 0 0 0 0 0 0 0 0
7 7 loop7 0 0 0 0 0 0 0 0 0 0 0
11 0 sr0 0 0 0 0 0 0 0 0 0 0 0
2 0 fd0 0 0 0 0 0 0 0 0 0 0 0
8 0 sda 636497 21176 11405890 12839819 140760 431327 4408732 15069993 0 3733362 27908407
8 1 sda1 233 1502 5844 1427 7 1 28 5 0 713 1432
8 2 sda2 636236 19577 11399046 12837936 119761 431326 4408704 15069485 0 3732777 27906038
253 0 dm-0 654545 0 11391458 13532637 546908 0 4371216 66773885 0 3711632 80307161
253 1 dm-1 835 0 6680 9963 4686 0 37488 484596 0 28949 494559
# cat /proc/diskstats
1 0 ram0 0 0 0 0 0 0 0 0 0 0 0
1 1 ram1 0 0 0 0 0 0 0 0 0 0 0
1 2 ram2 0 0 0 0 0 0 0 0 0 0 0
1 3 ram3 0 0 0 0 0 0 0 0 0 0 0
1 4 ram4 0 0 0 0 0 0 0 0 0 0 0
1 5 ram5 0 0 0 0 0 0 0 0 0 0 0
1 6 ram6 0 0 0 0 0 0 0 0 0 0 0
1 7 ram7 0 0 0 0 0 0 0 0 0 0 0
1 8 ram8 0 0 0 0 0 0 0 0 0 0 0
1 9 ram9 0 0 0 0 0 0 0 0 0 0 0
1 10 ram10 0 0 0 0 0 0 0 0 0 0 0
1 11 ram11 0 0 0 0 0 0 0 0 0 0 0
1 12 ram12 0 0 0 0 0 0 0 0 0 0 0
1 13 ram13 0 0 0 0 0 0 0 0 0 0 0
1 14 ram14 0 0 0 0 0 0 0 0 0 0 0
1 15 ram15 0 0 0 0 0 0 0 0 0 0 0
31 0 mtdblock0 0 0 0 0 0 0 0 0 0 0 0
31 1 mtdblock1 0 0 0 0 0 0 0 0 0 0 0
31 2 mtdblock2 0 0 0 0 0 0 0 0 0 0 0
31 3 mtdblock3 0 0 0 0 0 0 0 0 0 0 0
31 4 mtdblock4 0 0 0 0 0 0 0 0 0 0 0
179 0 mmcblk0 56 1633 2610 144 3 0 0 0 0 124 144
179 1 mmcblk0p1 40 1624 2485 128 0 0 0 0 0 108 128
/proc/schedstat
kernel调度器的统计信息
[root@F12 ~]# cat /proc/schedstat
version 15
timestamp 709068549
cpu0 24934 0 36895770 14884682 20338545 18793633 6426725307833 2621805225292 21933940
domain0 00000003 1364787 1323284 31537 81322500 10813 1234 385 1322899 412323 412001 95 1488417 277 3 1 412000 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1397074 110223 8843
cpu1 39083 0 36999115 11842635 22273051 20875974 5978531477970 3210542306167 25106143
domain0 00000003 1608334 1592831 9886 37120190 6146 620 11 1592820 59350 58963 115 835677 319 4 0 58963 0 0 0 0 0 0 0 0 146 3 143 0 0 0 0 0 0 1544912 90561 7684
/proc/zoneinfo
显示内存空间的统计信息,对分析虚拟内存行为很有用
# cat /proc/zoneinfo
Node 0, zone Normal
pages free 6649
min 512
low 640
high 768
scanned 0
spanned 16384
present 16256
nr_free_pages 6649
nr_inactive_anon 0
nr_active_anon 457
nr_inactive_file 3165
nr_active_file 1151
nr_unevictable 0
nr_mlock 0
nr_anon_pages 464
nr_mapped 314
nr_file_pages 4316
nr_dirty 0
nr_writeback 0
nr_slab_reclaimable 1135
nr_slab_unreclaimable 1654
nr_page_table_pages 66
nr_kernel_stack 40
nr_unstable 0
nr_bounce 0
nr_vmscan_write 0
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 0
protection: (0, 0)
pagesets
cpu: 0
count: 3
high: 18
batch: 3
all_unreclaimable: 0
start_pfn: 0
inactive_ratio: 1
/proc/self 链接到当前正在运行的进程