Miscellaneous icon indicating copy to clipboard operation
Miscellaneous copied to clipboard

Not a HASH reference at ./dev_tree.pl line 627

Open mbmather opened this issue 2 years ago • 1 comments

root@tycho:~# ./dev_tree.pl
➤ Command Executed: `dev_tree.pl`
➤ Displaying: IOMMU Groups > PCI > All Bus Devices (format: default)
IOMMU: 
├── IOMMU_Group: 0
│   └── 00:01.0 <Host> "Renoir PCIe Dummy Host Bridge" (AMD) [1022:1632]
├── IOMMU_Group: 1
│   └── 00:01.1 <PCI> "Renoir PCIe GPP Bridge" (AMD) [1022:1633]
├── IOMMU_Group: 2
│   └── 00:02.0 <Host> "Renoir PCIe Dummy Host Bridge" (AMD) [1022:1632]
├── IOMMU_Group: 3
│   └── 00:02.1 <PCI> "Renoir/Cezanne PCIe GPP Bridge" (AMD) [1022:1634]
├── IOMMU_Group: 4
│   └── 00:02.2 <PCI> "Renoir/Cezanne PCIe GPP Bridge" (AMD) [1022:1634]
├── IOMMU_Group: 5
│   └── 00:08.0 <Host> "Renoir PCIe Dummy Host Bridge" (AMD) [1022:1632]
├── IOMMU_Group: 6
│   └── 00:08.1 <PCI> "Renoir Internal PCIe GPP Bridge to Bus" (AMD) [1022:1635]
├── IOMMU_Group: 7
│   └── 00:08.2 <PCI> "Renoir Internal PCIe GPP Bridge to Bus" (AMD) [1022:1635]
├── IOMMU_Group: 8
│   ├── 00:14.0 <SMBus> "FCH SMBus Controller" (AMD) [1022:790b]
│   └── 00:14.3 <ISA> "FCH LPC Bridge" (AMD) [1022:790e]
├── IOMMU_Group: 9
│   ├── 00:18.0 <Host> "Cezanne Data Fabric; Function 0" (AMD) [1022:166a]
│   ├── 00:18.1 <Host> "Cezanne Data Fabric; Function 1" (AMD) [1022:166b]
│   ├── 00:18.2 <Host> "Cezanne Data Fabric; Function 2" (AMD) [1022:166c]
│   ├── 00:18.3 <Host> "Cezanne Data Fabric; Function 3" (AMD) [1022:166d]
│   ├── 00:18.4 <Host> "Cezanne Data Fabric; Function 4" (AMD) [1022:166e]
│   ├── 00:18.5 <Host> "Cezanne Data Fabric; Function 5" (AMD) [1022:166f]
│   ├── 00:18.6 <Host> "Cezanne Data Fabric; Function 6" (AMD) [1022:1670]
│   └── 00:18.7 <Host> "Cezanne Data Fabric; Function 7" (AMD) [1022:1671]
├── IOMMU_Group: 10
│   ├── 01:00.0 <VGA> "GP106 [GeForce GTX 1060 3GB]" (NVIDIA) [10de:1c02]
│   └── 01:00.1 <Audio> "GP106 High Definition Audio Controller" (NVIDIA) [10de:10f1]
├── IOMMU_Group: 11
│   ├── 02:00.0 <USB> "400 Series Chipset USB 3.1 xHCI Compliant Host Controller" (AMD) [1022:43d5]
│   │   ├── usb1 <usb> "xHCI Host Controller" (Linux kernel) [1d6b:0002] {1:1}
│   │   │   └── 1-6 <usb> "2.4G Wireless Receiver" (CX) [05ac:0256] {1:2}
│   │   │       ├── 1-6:1.0 <usbfs>
│   │   │       └── 1-6:1.1 <usbfs>
│   │   └── usb2 <usb> "xHCI Host Controller" (Linux kernel) [1d6b:0003] {2:1}
│   ├── 02:00.1 <SATA> "400 Series Chipset SATA Controller" (AMD) [1022:43c8]
│   │   ├── disk: sda
│   │   ├── disk: sdb
│   │   ├── disk: sdc
│   │   └── disk: sdd
│   ├── 02:00.2 <PCI> "400 Series Chipset PCIe Bridge" (AMD) [1022:43c6]
│   ├── 03:00.0 <PCI> "400 Series Chipset PCIe Port" (AMD) [1022:43c7]
│   ├── 03:04.0 <PCI> "400 Series Chipset PCIe Port" (AMD) [1022:43c7]
│   ├── 03:05.0 <PCI> "400 Series Chipset PCIe Port" (AMD) [1022:43c7]
│   ├── 03:06.0 <PCI> "400 Series Chipset PCIe Port" (AMD) [1022:43c7]
│   ├── 03:07.0 <PCI> "400 Series Chipset PCIe Port" (AMD) [1022:43c7]
│   └── 08:00.0 <Ethernet> "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller" (Realtek) [10ec:8168]
│       └── interface: enp8s0 <r8169> [08:bf:b8:xx:xx:xx]
│           └── bridge: vmbr0
├── IOMMU_Group: 12
│   └── 09:00.0 <NVME> "RTS5765DL NVMe SSD Controller (DRAM-less)" (Realtek) [10ec:5765]
│       └── disk: nvme0n1
│           ├── part: nvme0n1p1
│           ├── part: nvme0n1p2
│           ├── part: nvme0n1p3
Not a HASH reference at ./dev_tree.pl line 627.
root@tycho:~# 

I ran the script with --format generic and removed the parts that are irrelevant.

....
      HASH:12
        parent_id => iommu
        parent_type => IOMMU
        type => IOMMU_Group
        HASH:children
          HASH:0000:09:00.0
            class => Non-Volatile memory controller
            description => RTS5765DL NVMe SSD Controller (DRAM-less)
            device => 0x5765
            id => 0000:09:00.0
            parent_id => 12
            parent_type => IOMMU_Group
            type => PCI_slot
            vendor => 0x10ec
            vendor_name => Realtek Semiconductor Co., Ltd.
            HASH:children
              HASH:nvme0n1
                fstype => undef
                fsuse% => undef
                id => nvme0n1
                label => undef
                model => SPCC M.2 PCIe SSD
                parent_id => 0000:09:00.0
                parent_type => pci
                parttypename => undef
                serial => 230292405130207
                size => 953.9G
                type => disk
                HASH:children
                  HASH:nvme0n1p1
                    fstype => undef
                    fsuse% => undef
                    id => nvme0n1p1
                    label => undef
                    model => undef
                    parent_id => nvme0n1
                    parent_type => blk
                    parttypename => BIOS boot
                    serial => undef
                    size => 1007K
                    type => part
                  HASH:nvme0n1p2
                    fstype => vfat
                    fsuse% => 0%
                    id => nvme0n1p2
                    label => undef
                    model => undef
                    parent_id => nvme0n1
                    parent_type => blk
                    parttypename => EFI System
                    serial => undef
                    size => 1G
                    type => part
                  HASH:nvme0n1p3
                    fstype => LVM2_member
                    fsuse% => undef
                    id => nvme0n1p3
                    label => undef
                    model => undef
                    parent_id => nvme0n1
                    parent_type => blk
                    parttypename => Linux LVM
                    serial => undef
                    size => 952.9G
                    type => part
                    ARRAY:children
                      HASH:
                        fstype => ext4
                        fsuse% => 20%
                        id => pve-root
                        label => undef
                        model => undef
                        parttypename => undef
                        serial => undef
                        size => 96G
                        type => lvm
      HASH:13
        parent_id => iommu
        parent_type => IOMMU
....

I am not a programmer but I was able to get the output to complete by making this change at that location.

          if (ref ($ref->{$k}) eq 'ARRAY') {
            print"> WARNING: ARRAY (\$ref->{\$k}) found\n";
          } else {
            $indent_counter{$tree_type . '__' . $key}{'children_total'} = scalar keys %{$ref->{$k}};
          }

Hope this helps.

mbmather avatar Dec 30 '23 01:12 mbmather

Thanks :)

I'll look at it next time my server is up. Currently waiting for some case parts after a gravity catastrophe broke the front panel (luckily no interior components hurt).

Jahfry avatar Jan 17 '24 22:01 Jahfry