Skip to content

Bogus Example for lspci #34

@sdimitro

Description

@sdimitro
sdb[gw]> man lspci
SUMMARY
    lspci [-h]

    Locate and print PCI devices (like lspci(8)).

    options:
      -h, --help  show this help message and exit

    If this command is used to end a pipeline, it will print a human-
    readable decoding of the 'struct pci_dev *' objects. For the 'raw'
    object contents, pipe the output of this command into 'echo'.

    This command accepts inputs of type 'void *', and 'struct
    pci_dev', which will be converted to 'struct pci_dev *'.

    This is a Locator for struct pci_dev *.  It finds objects of this
    type and outputs or pretty-prints them.  It accepts any Walkable
    type (run 'walk' for a list). This command can be used to start a
    pipeline, in which case it will consume no objects as input;
    instead it will locate all objects of type 'struct pci_dev *', and
    emit them as output.

DESCRIPTION
    Walks ``pci_root_buses`` recursively and yields every
    ``struct pci_dev`` in the system.  When used at the end
    of a pipeline, prints a table with BDF address, vendor,
    device, class code, and bound driver name.

EXAMPLES
    List all PCI devices:

        sdb> lspci
        BDF           VEN  DEV  CLASS    DRIVER
        ------------- ---- ---- -------- ----------------
        0000:00.0     8086 2030 060000   ioatdma
        0000:01.0     10de 2330 030200   nvidia

    Filter to NVIDIA GPUs (vendor 0x10de):

        sdb> lspci | filter obj.vendor == 0x10de | lspci

sdb[gw]> lspci | filter obj.vendor == 0x10de | lspci
usage: filter [-h] expr
filter: error: unrecognized arguments: == 0x10de

Need quotations:

sdb[gw]> lspci | filter 'obj.vendor == 0x10de' | lspci
BDF VEN DEV CLASS DRIVER
--- --- --- ----- ------
sdb[gw]> lspci | filter 'obj.vendor == 0x15b3' | lspci
BDF       VEN  DEV  CLASS  DRIVER
--------- ---- ---- ------ ---------
00c1:00.0 15b3 a2dc 020000 mlx5_core
00c1:00.1 15b3 6001 010802
00c1:00.2 15b3 101e 020000 mlx5_core
00c1:00.3 15b3 101e 020000 mlx5_core
00c1:00.4 15b3 101e 020000 mlx5_core
00c1:00.5 15b3 101e 020000 mlx5_core
00c1:00.6 15b3 101e 020000 mlx5_core
00c1:00.7 15b3 101e 020000 mlx5_core
00c1:01.0 15b3 101e 020000 mlx5_core
00c1:01.1 15b3 101e 020000 mlx5_core

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions