首页 > 代码库 > lspci命令使用记录
lspci命令使用记录
(1)工具下载地址:
There is also a public GIT tree at git://git.kernel.org/pub/scm/utils/pciutils/pciutils.git containing the current development code. You can also view the shortlog of the development tree.
git clone git://git.kernel.org/pub/scm/utils/pciutils/pciutils.git 即可下载代码到pciutils目录
(2)工具编译:
root权限
make
make install
在/usr/local/sbin目录下生成
lspci setpci update-pciids
在/usr/local/share下生成:
aclocal ca-certificates doc fonts info man pci.ids pci.ids.old sgml wayland xml
root@ubuntu:/mnt/shared/pciutils# make install
make -C lib all
make[1]: Entering directory `/mnt/shared/pciutils/lib‘
make[1]: Nothing to be done for `all‘.
make[1]: Leaving directory `/mnt/shared/pciutils/lib‘
install -d -m 755 /usr/local/sbin /usr/local/share /usr/local/share/man/man8 /usr/local/share/man/man7
install -c -m 755 -s lspci setpci /usr/local/sbin
install -c -m 755 update-pciids /usr/local/sbin
install -c -m 644 pci.ids /usr/local/share
install -c -m 644 lspci.8 setpci.8 update-pciids.8 /usr/local/share/man/man8
install -c -m 644 pcilib.7 /usr/local/share/man/man7
root@ubuntu:/mnt/shared/pciutils# ls
(3)lspci 的使用
lspci :
lspci -v:列出所有pcie设备
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci 00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01) 00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01) 00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08) 00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) 00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08) 00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10) 00:0f.0 VGA compatible controller: VMware SVGA II Adapter 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01) 00:11.0 PCI bridge: VMware PCI bridge (rev 02)
lspci -d vendor:device :列出使用vendorid 和device id指明的设备信息
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -d 1000:0030 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01) linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$
lspci -vv:列出详细信息
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -d 1000:0030 -vv 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01) Subsystem: VMware LSI Logic Parallel SCSI Controller Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 64 (1500ns min, 63750ns max) Interrupt: pin A routed to IRQ 17 Region 0: I/O ports at 1400 [size=256] Region 1: Memory at c8040000 (64-bit, non-prefetchable) [size=128K] Region 3: Memory at c8020000 (64-bit, non-prefetchable) [size=128K] [virtual] Expansion ROM at c0008000 [disabled] [size=16K] Kernel driver in use: mptspi
lspci -vxx:列出配置空间信息
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -d 1000:0030 -vxx 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01) Subsystem: VMware LSI Logic Parallel SCSI Controller Flags: bus master, medium devsel, latency 64, IRQ 17 I/O ports at 1400 [size=256] Memory at c8040000 (64-bit, non-prefetchable) [size=128K] Memory at c8020000 (64-bit, non-prefetchable) [size=128K] [virtual] Expansion ROM at c0008000 [disabled] [size=16K] Kernel driver in use: mptspi 00: 00 10 30 00 07 00 80 02 01 00 00 01 00 40 00 00 10: 01 14 00 00 04 00 04 c8 00 00 00 00 04 00 02 c8 20: 00 00 00 00 00 00 00 00 00 00 00 00 ad 15 76 19 30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 01 06 ff
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -d 1000:0030 -x 00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01) 00: 00 10 30 00 07 00 80 02 01 00 00 01 00 40 00 00 10: 01 14 00 00 04 00 04 c8 00 00 00 00 04 00 02 c8 20: 00 00 00 00 00 00 00 00 00 00 00 00 ad 15 76 19 30: 00 00 00 00 00 00 00 00 00 00 00 00 0b 01 06 ff
lspci -n:列出device id号
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -n 00:00.0 0600: 8086:7190 (rev 01) 00:01.0 0604: 8086:7191 (rev 01) 00:07.0 0601: 8086:7110 (rev 08) 00:07.1 0101: 8086:7111 (rev 01) 00:07.3 0680: 8086:7113 (rev 08) 00:07.7 0880: 15ad:0740 (rev 10) 00:0f.0 0300: 15ad:0405 00:10.0 0100: 1000:0030 (rev 01) 00:11.0 0604: 15ad:0790 (rev 02) 00:15.0 0604: 15ad:07a0 (rev 01) 00:15.1 0604: 15ad:07a0 (rev 01) 00:15.2 0604: 15ad:07a0 (rev 01) 00:15.3 0604: 15ad:07a0 (rev 01) 00:15.4 0604: 15ad:07a0 (rev 01)
lspci -nn:列出devcie id和设备名称
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -nn 00:00.0 Host bridge [0600]: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge [8086:7190] (rev 01) 00:01.0 PCI bridge [0604]: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge [8086:7191] (rev 01) 00:07.0 ISA bridge [0601]: Intel Corporation 82371AB/EB/MB PIIX4 ISA [8086:7110] (rev 08) 00:07.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01) 00:07.3 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 08) 00:07.7 System peripheral [0880]: VMware Virtual Machine Communication Interface [15ad:0740] (rev 10) 00:0f.0 VGA compatible controller [0300]: VMware SVGA II Adapter [15ad:0405] 00:10.0 SCSI storage controller [0100]: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI [1000:0030] (rev 01) 00:11.0 PCI bridge [0604]: VMware PCI bridge [15ad:0790] (rev 02) 00:15.0 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01) 00:15.1 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01) 00:15.2 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01) 00:15.3 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01) 00:15.4 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
lspci -t:列出设备树
linux@ubuntu:/sys/class/pci_bus/0000:00/device/0000:00:10.0$ lspci -t -[0000:00]-+-00.0 +-01.0-[01]-- +-07.0 +-07.1 +-07.3 +-07.7 +-0f.0 +-10.0 +-11.0-[02]--+-00.0 | +-01.0 | +-02.0 | \-03.0 +-15.0-[03]--
lspci命令使用记录