Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pci_vendor, pci_device, pci_class, pci_subclass decoders #255

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented Aug 29, 2023

Running the example in a vm:

ivan@vm:~$ sudo lspci
00:00.0 Host bridge: Red Hat, Inc. QEMU PCIe Host bridge
00:01.0 Non-Volatile memory controller: Red Hat, Inc. QEMU NVM Express Controller (rev 02)
00:02.0 Non-Volatile memory controller: Red Hat, Inc. QEMU NVM Express Controller (rev 02)
00:03.0 Unclassified device [0002]: Red Hat, Inc. Virtio filesystem
00:04.0 Unclassified device [0002]: Red Hat, Inc. Virtio filesystem

ivan@vm:~$ curl -s http://localhost:9435/metrics | fgrep pci
ebpf_exporter_build_info{branch="ivan/pci",goarch="arm64",goos="linux",goversion="go1.19.8",revision="072572d",tags="unknown",version="v2.2.0-15-g072572d"} 1
ebpf_exporter_ebpf_program_info{config="pci",id="279",program="pci_user_read_config_byte",tag="d57be3affc84ce20"} 1
ebpf_exporter_ebpf_program_info{config="pci",id="280",program="pci_user_read_config_word",tag="d57be3affc84ce20"} 1
ebpf_exporter_ebpf_program_info{config="pci",id="281",program="pci_user_read_config_dword",tag="d57be3affc84ce20"} 1
ebpf_exporter_enabled_configs{name="pci"} 1
# HELP ebpf_exporter_pci_user_read_config_ops_total The number of operations reading pci configs
# TYPE ebpf_exporter_pci_user_read_config_ops_total counter
ebpf_exporter_pci_user_read_config_ops_total{pci_class="Bridge",pci_device="QEMU PCIe Host bridge",pci_subclass="Host bridge",pci_vendor="Red Hat, Inc."} 16
ebpf_exporter_pci_user_read_config_ops_total{pci_class="Mass storage controller",pci_device="QEMU NVM Express Controller",pci_subclass="Non-Volatile memory controller",pci_vendor="Red Hat, Inc."} 32
ebpf_exporter_pci_user_read_config_ops_total{pci_class="Unclassified device",pci_device="Virtio filesystem",pci_subclass="unknown pci subclass: 0x02 (class 0x00)",pci_vendor="Red Hat, Inc."} 32

@bobrik bobrik changed the title Add pci_vendor decoder Add pci_vendor, pci_device, pci_class, pci_subclass decoders Aug 30, 2023
Running the example in a vm:

    ivan@vm:~$ sudo lspci
    00:00.0 Host bridge: Red Hat, Inc. QEMU PCIe Host bridge
    00:01.0 Non-Volatile memory controller: Red Hat, Inc. QEMU NVM Express Controller (rev 02)
    00:02.0 Non-Volatile memory controller: Red Hat, Inc. QEMU NVM Express Controller (rev 02)
    00:03.0 Unclassified device [0002]: Red Hat, Inc. Virtio filesystem
    00:04.0 Unclassified device [0002]: Red Hat, Inc. Virtio filesystem

    ivan@vm:~$ curl -s http://localhost:9435/metrics | fgrep pci
    ebpf_exporter_build_info{branch="ivan/pci",goarch="arm64",goos="linux",goversion="go1.19.8",revision="072572d",tags="unknown",version="v2.2.0-15-g072572d"} 1
    ebpf_exporter_ebpf_program_info{config="pci",id="279",program="pci_user_read_config_byte",tag="d57be3affc84ce20"} 1
    ebpf_exporter_ebpf_program_info{config="pci",id="280",program="pci_user_read_config_word",tag="d57be3affc84ce20"} 1
    ebpf_exporter_ebpf_program_info{config="pci",id="281",program="pci_user_read_config_dword",tag="d57be3affc84ce20"} 1
    ebpf_exporter_enabled_configs{name="pci"} 1
    # HELP ebpf_exporter_pci_user_read_config_ops_total The number of operations reading pci configs
    # TYPE ebpf_exporter_pci_user_read_config_ops_total counter
    ebpf_exporter_pci_user_read_config_ops_total{pci_class="Bridge",pci_device="QEMU PCIe Host bridge",pci_subclass="Host bridge",pci_vendor="Red Hat, Inc."} 16
    ebpf_exporter_pci_user_read_config_ops_total{pci_class="Mass storage controller",pci_device="QEMU NVM Express Controller",pci_subclass="Non-Volatile memory controller",pci_vendor="Red Hat, Inc."} 32
    ebpf_exporter_pci_user_read_config_ops_total{pci_class="Unclassified device",pci_device="Virtio filesystem",pci_subclass="unknown pci subclass: 0x02 (class 0x00)",pci_vendor="Red Hat, Inc."} 32
@bobrik bobrik merged commit 89b3fa2 into master Sep 1, 2023
@bobrik bobrik deleted the ivan/pci branch September 1, 2023 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant