In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the usage of the Linux basic command lspci". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of the Linux basic command lspci".
Lspci
Lspci is a utility that displays information about pci buses and the devices connected to them in the system.
By default, it displays a simple list of devices. Use the options described below to request more detailed output or output that other programs use to parse.
If you want to report the bug in the PCI device driver or lspci itself, use the output of the option "lspci-vvx" or better "lspci-vvxxx" (however, there may be warnings).
Some parts of the output, especially in highly verbose mode, only experienced PCI hackers can understand Proba-Bly. For the exact definition of the field, see the PCI specification or the head er.h and / usr/include/linux/pci.h files.
On many operating systems, access to certain parts of the PCI configuration space is limited to root users, so the functionality of lspci is limited to the average user. However, lspci tries to display as much information as possible and mark all other information as text
The scope of application of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1. Grammar
Lspci [options]
In the lspci command, we often see some numbers in the format "[]: []. []", such as "0014 01.0". This parameter is the bus number, the second is the slot number, and the third is the function number. They are all hexadecimal numbers.
2. List of options
Option
Description
Basic display mode
-m
Dump device information in a backward-compatible and machine-readable manner
-mm
Dump device information in a machine-readable manner for script parsing
-t
Displays the hierarchical relationship of pci devices in a tree structure, including all buses, bridges, devices and connections between them
Display option
-n
Displays the manufacturer and device code of the pci device
-v
Display details of all devices
-vv
Display device information in a more detailed manner
-k
Displays the kernel drivers that process each device and the kernel modules that can handle the device. By default, when-v is turned on in normal output mode. (currently, it only works on Linux with kernel 2.6 or later.)
-x
Displays the hexadecimal dump of the standard portion of the configuration space (the first 64 bytes or 128bytes of the CardBus bridge).
-xxx
Displays the hexadecimal dump of the entire PCI configuration space. When you try to read parts of the configuration space, it is only available when several PCI devices crash, and is only suitable for root users. This kind of behavior may not violate the PCI standard, but at least it is stupid. However, such devices are rare, so you don't have to worry too much.
-xxxx
Displays hexadecimal dumps available for extended (4096-byte) PCI configuration space on PCI-X2.0 and PCIExpress buses
-b
A bus-centric view. Displays all irq numbers and addresses seen by the card on the pci bus. Note that it is not seen by the kernel
-D
The PCI domain number is always displayed. By default, lspci skips them on machines with only domain 0.
The option to resolve ID as a name
-n
Display the PCI vendor and equipment codes as numbers instead of looking for them in the PCI ID list.
-nn
Displays the code and name of the pci vendor and equipment
-Q
If the device is not found in the local pci.id file, use DNS to query the central PCI ID database. If the DNS query is successful, the results will be cached in ~ / .pciids-cache, and even if-Q is no longer given, it will be recognized in subsequent runs. Be careful when using this switch in automatic scripts to avoid overloading the database server.
Same as "- Q", but the local cache is reset
-Q
Query the central database, even locally there is cached data to look up. Use this method if you suspect that the displayed entry is incorrect.
Select options for the device
-s [domain]: [bus]: [slot]. [function]
Only devices in the specified domain are displayed (if your computer has several host bridges, they can share the common bus numbering space, or each device can address its own PCI domain; domain number is 0 to ffff), bus number (0 to ff), slot number (0 to 1f), function number (0 to 7). The address can be omitted or set to "*", both of which mean "any value". All the numbers are in hexadecimal. For example, "0:" represents all devices on bus 0, "0" represents all functions of device 0 on any bus, "0.3" selects the third function of device 0 on all buses, and "4" shows only the fourth function of each device.
-d [manufacturer: equipment]
Displays information about the specified manufacturer and equipment, and the manufacturer number and device number are in hexadecimal.
Other options
-I
Specifies the pci device number file, and the default file is / usr/share/hwdata/pci.ids
-p
Use the specified file as the mapping file for PCI ID. / lib/Module/kernel_version/Modes.pcimap is used by default
-M
The bus mapping mode is invoked, which thoroughly scans all pci devices, including those behind the misconfigured bridge. This option provides meaningful results only in direct hardware access mode and usually requires root permissions. Note that the bus mapper scans only the PCI domain 0.
PCI device access option
A
The library supports multiple ways to access PCI hardware. By default, it uses the first available access method, but you can use this option to override this decision. You can use "- A help" to see the available methods first.
-O =
The behavior of the library is controlled by multiple named parameters. This option allows you to set the value of any parameter. Use "- Ohelp" to get a list of known parameters and their default values.
-H1
Direct access to hardware through Intel configuration mechanism 1
-H2
Direct access to hardware through Intel configuration mechanism 2
-F
Instead of accessing the real hardware, read the value list of the device and its configuration register from a given file generated by the previously run lspci-x, which is useful for analyzing user-provided error reports, because you can display the hardware configuration in any way without disturbing the user with more dump requests.
-G
Improve the debugging level of the library
3. Description
1) about the "- m" option
If you plan to process lspci output automatically, use one of the machine-readable output formats (- m,-vm,-vmm) described in this section. All other formats can change from version to version of lspci. All the numbers are printed in hexadecimal. If you want to deal with numeric ID instead of names, add the-n switch.
In a simple format, each device is described on a single line, and these parameters are formatted as parameters suitable for passing to the shell script, that is, values separated by spaces, referenced and escaped if necessary. Some of these parameters are location: slot, class, vendor name, device name, subsystem name, and subsystem name (if the device does not have a subsystem, the last two parameters are empty); the rest are options
2) about the "- vmm" option
The detailed output is a sequence of records separated by blank lines, with each record describing a device with one line, each containing a 'tag:value' pair. Tags and values are separated by a single tab. The record or the rows in the record are not arranged in any particular order. Tags are case sensitive. Here is the tag that has been defined:
Slot, the name of the slot where the device is located
Class, class name
Vendor, manufacturer name
Device, device name
SVendor, name of the subsystem vendor
SDevice, the name of the child device
PhySlot, the physical slot where the device is located
Rev, repair serial number
ProgIf, programming interface
Driver, which is currently processing the kernel driver of the device
Module, report of kernel module
4. Examples
1) display in a machine readable manner
[root@localhost ntop-4.0.1] # lspci-m
00RV 00.0 "Host bridge"Intel Corporation"440FX-82441FX PMC [Natoma]"-R02 "
00Rom 01.0 "ISA bridge"Intel Corporation"82371SB PIIX3 ISA [Natoma/Triton II]"
00Rom 01.1 "IDE interface"Intel Corporation"82371AB/EB/MB PIIX4 IDE"-R01-p8a "
00Rom 02.0 "VGA compatible controller"InnoTek Systemberatung GmbH"VirtualBox Graphics Adapter"
2) display device code and name
[root@localhost ntop-4.0.1] # lspci-nn
/ / equipment code 0600, manufacturer code 8086Suzhou 1237
0082441FX PMC 00.0 Host bridge [0600]: Intel Corporation 440FX-82441FX PMC [Natoma] [8086 82441FX PMC 1237] (rev 02)
00:01.0 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000]
00rev 01.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086 Swiss 7111] (rev 01)
3) display with tree structure
[root@localhost ntop-4.0.1] # lspci-t
/ / bus number, slot, function number
-[0000VOG 00]-+-00.0
+-01.0
+-01.1
+-02.0
4) display the device information at the specified location
[root@localhost ntop-4.0.1] # lspci-s 0000VR 01.0
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
5) display the equipment information of the specified manufacturer and equipment number
[root@localhost ntop-4.0.1] # lspci-d 8086 purl 1237
00RV 00.0 Host bridge: Intel Corporation 440FX-82441FX PMC [Natoma] (rev 02)
Thank you for your reading, the above is the content of "the usage of the Linux basic command lspci". After the study of this article, I believe you have a deeper understanding of the usage of the Linux basic command lspci, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.