From 914603873e333e7e62b8ea37663f55083b203abd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 17:32:51 +0000 Subject: [PATCH] build(deps): bump github.com/jaypipes/ghw from 0.13.0 to 0.16.0 Bumps [github.com/jaypipes/ghw](https://github.com/jaypipes/ghw) from 0.13.0 to 0.16.0. - [Release notes](https://github.com/jaypipes/ghw/releases) - [Commits](https://github.com/jaypipes/ghw/compare/v0.13.0...v0.16.0) --- updated-dependencies: - dependency-name: github.com/jaypipes/ghw dependency-version: 0.16.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/jaypipes/ghw/README.md | 71 ++++++- vendor/github.com/jaypipes/ghw/alias.go | 16 +- vendor/github.com/jaypipes/ghw/host.go | 58 +++--- .../ghw/pkg/accelerator/accelerator.go | 84 +++++++++ .../ghw/pkg/accelerator/accelerator_linux.go | 80 ++++++++ .../ghw/pkg/accelerator/accelerator_stub.go | 19 ++ .../jaypipes/ghw/pkg/block/block_linux.go | 4 + vendor/github.com/jaypipes/ghw/pkg/cpu/cpu.go | 29 ++- .../jaypipes/ghw/pkg/cpu/cpu_darwin.go | 3 + .../jaypipes/ghw/pkg/cpu/cpu_linux.go | 50 ++++- .../jaypipes/ghw/pkg/cpu/cpu_windows.go | 12 +- .../jaypipes/ghw/pkg/gpu/gpu_linux.go | 25 ++- .../jaypipes/ghw/pkg/memory/memory.go | 19 +- .../jaypipes/ghw/pkg/memory/memory_linux.go | 174 +++++++++++++++--- vendor/github.com/jaypipes/ghw/pkg/pci/pci.go | 2 +- .../jaypipes/ghw/pkg/pci/pci_linux.go | 2 +- .../ghw/pkg/snapshot/clonetree_linux.go | 1 + .../jaypipes/ghw/pkg/snapshot/pack.go | 30 ++- .../jaypipes/ghw/pkg/topology/topology.go | 23 ++- .../ghw/pkg/topology/topology_linux.go | 4 +- .../ghw/pkg/topology/topology_windows.go | 4 +- vendor/modules.txt | 3 +- 24 files changed, 603 insertions(+), 116 deletions(-) create mode 100644 vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator.go create mode 100644 vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_linux.go create mode 100644 vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_stub.go diff --git a/go.mod b/go.mod index 02d8cda1..a6902e3e 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/nftables v0.2.0 github.com/gorilla/mux v1.8.1 - github.com/jaypipes/ghw v0.13.0 + github.com/jaypipes/ghw v0.16.0 github.com/linuxkit/virtsock v0.0.0-20220523201153-1a23e78aa7a2 github.com/pkg/errors v0.9.1 github.com/safchain/ethtool v0.4.1 diff --git a/go.sum b/go.sum index 187f4335..8b3bdba2 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/jaypipes/ghw v0.13.0 h1:log8MXuB8hzTNnSktqpXMHc0c/2k/WgjOMSUtnI1RV4= -github.com/jaypipes/ghw v0.13.0/go.mod h1:In8SsaDqlb1oTyrbmTC14uy+fbBMvp+xdqX51MidlD8= +github.com/jaypipes/ghw v0.16.0 h1:3HurCTS38VNpeQLo5fIdZsySuo/qAfpPSJ5t05QBFPM= +github.com/jaypipes/ghw v0.16.0/go.mod h1:In8SsaDqlb1oTyrbmTC14uy+fbBMvp+xdqX51MidlD8= github.com/jaypipes/pcidb v1.0.1 h1:WB2zh27T3nwg8AE8ei81sNRb9yWBii3JGNJtT7K9Oic= github.com/jaypipes/pcidb v1.0.1/go.mod h1:6xYUz/yYEyOkIkUt2t2J2folIuZ4Yg6uByCGFXMCeE4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= diff --git a/vendor/github.com/jaypipes/ghw/README.md b/vendor/github.com/jaypipes/ghw/README.md index c1cdb106..bad7c86e 100644 --- a/vendor/github.com/jaypipes/ghw/README.md +++ b/vendor/github.com/jaypipes/ghw/README.md @@ -62,6 +62,7 @@ hardware: * [`ghw.Network()`](#network) * [`ghw.PCI()`](#pci) * [`ghw.GPU()`](#gpu) (graphical processing unit) +* [`ghw.Accelerator()`](#accelerator) (processing accelerators, AI) * [`ghw.Chassis()`](#chassis) * [`ghw.BIOS()`](#bios) * [`ghw.Baseboard()`](#baseboard) @@ -76,8 +77,8 @@ information about the CPUs on the host system. * `ghw.CPUInfo.TotalCores` has the total number of physical cores the host system contains -* `ghw.CPUInfo.TotalThreads` has the total number of hardware threads the - host system contains +* `ghw.CPUInfo.TotalHardwareThreads` has the total number of hardware threads + the host system contains * `ghw.CPUInfo.Processors` is an array of `ghw.Processor` structs, one for each physical processor package contained in the host @@ -85,10 +86,10 @@ Each `ghw.Processor` struct contains a number of fields: * `ghw.Processor.ID` is the physical processor `uint32` ID according to the system -* `ghw.Processor.NumCores` is the number of physical cores in the processor - package -* `ghw.Processor.NumThreads` is the number of hardware threads in the processor +* `ghw.Processor.TotalCores` is the number of physical cores in the processor package +* `ghw.Processor.TotalHardwareThreads` is the number of hardware threads in the + processor package * `ghw.Processor.Vendor` is a string containing the vendor name * `ghw.Processor.Model` is a string containing the vendor's model name * `ghw.Processor.Capabilities` (Linux only) is an array of strings indicating @@ -102,8 +103,8 @@ A `ghw.ProcessorCore` has the following fields: core. Note that this does *not* necessarily equate to a zero-based index of the core within a physical package. For example, the core IDs for an Intel Core i7 are 0, 1, 2, 8, 9, and 10 -* `ghw.ProcessorCore.NumThreads` is the number of hardware threads associated - with the core +* `ghw.ProcessorCore.TotalHardwareThreads` is the number of hardware threads + associated with the core * `ghw.ProcessorCore.LogicalProcessors` is an array of ints representing the logical processor IDs assigned to any processing unit for the core. These are sometimes called the "thread siblings". Logical processor IDs are the @@ -893,7 +894,7 @@ information about the host computer's graphics hardware. The `ghw.GPUInfo` struct contains one field: * `ghw.GPUInfo.GraphicCards` is an array of pointers to `ghw.GraphicsCard` - structs, one for each graphics card found for the systen + structs, one for each graphics card found for the system Each `ghw.GraphicsCard` struct contains the following fields: @@ -945,6 +946,60 @@ information `ghw.TopologyNode` struct if you'd like to dig deeper into the NUMA/topology subsystem +### Accelerator + +The `ghw.Accelerator()` function returns a `ghw.AcceleratorInfo` struct that contains +information about the host computer's processing accelerator hardware. In this category +we can find used hardware for AI. The hardware detected in this category will be +processing accelerators (PCI class `1200`), 3D controllers (`0302`) and Display +controllers (`0380`). + +The `ghw.AcceleratorInfo` struct contains one field: + +* `ghw.AcceleratorInfo.Devices` is an array of pointers to `ghw.AcceleratorDevice` + structs, one for each processing accelerator card found for the system. + +Each `ghw.AcceleratorDevice` struct contains the following fields: + +* `ghw.AcceleratorDevice.Address` is the PCI address for the processing accelerator card. +* `ghw.AcceleratorDevice.PCIDevice` is a pointer to a `ghw.PCIDevice` struct. + describing the processing accelerator card. This may be `nil` if no PCI device + information could be determined for the card. + +```go +package main + +import ( + "fmt" + + "github.com/jaypipes/ghw" +) + +func main() { + accel, err := ghw.Accelerator() + if err != nil { + fmt.Printf("Error getting processing accelerator info: %v", err) + } + + fmt.Printf("%v\n", accel) + + for _, card := range accel.Devices { + fmt.Printf(" %v\n", device) + } +} +``` + +Example output from a testing machine: + +``` +processing accelerators (1 device) + device @0000:00:04.0 -> driver: 'fake_pci_driver' class: 'Processing accelerators' vendor: 'Red Hat, Inc.' product: 'QEMU PCI Test Device' +``` + +**NOTE**: You can [read more](#pci) about the fields of the `ghw.PCIDevice` +struct if you'd like to dig deeper into PCI subsystem and programming interface +information + ### Chassis The `ghw.Chassis()` function returns a `ghw.ChassisInfo` struct that contains diff --git a/vendor/github.com/jaypipes/ghw/alias.go b/vendor/github.com/jaypipes/ghw/alias.go index 83157d00..9c403d96 100644 --- a/vendor/github.com/jaypipes/ghw/alias.go +++ b/vendor/github.com/jaypipes/ghw/alias.go @@ -7,6 +7,7 @@ package ghw import ( + "github.com/jaypipes/ghw/pkg/accelerator" "github.com/jaypipes/ghw/pkg/baseboard" "github.com/jaypipes/ghw/pkg/bios" "github.com/jaypipes/ghw/pkg/block" @@ -154,8 +155,12 @@ var ( type Architecture = topology.Architecture const ( - ARCHITECTURE_SMP = topology.ARCHITECTURE_SMP - ARCHITECTURE_NUMA = topology.ARCHITECTURE_NUMA + ArchitectureSMP = topology.ArchitectureSMP + // DEPRECATED: Please use ArchitectureSMP + ARCHITECTURE_SMP = topology.ArchitectureSMP + ArchitectureNUMA = topology.ArchitectureNUMA + // DEPRECATED: Please use ArchitectureNUMA + ARCHITECTURE_NUMA = topology.ArchitectureNUMA ) type PCIInfo = pci.Info @@ -179,3 +184,10 @@ type GraphicsCard = gpu.GraphicsCard var ( GPU = gpu.New ) + +type AcceleratorInfo = accelerator.Info +type AcceleratorDevice = accelerator.AcceleratorDevice + +var ( + Accelerator = accelerator.New +) diff --git a/vendor/github.com/jaypipes/ghw/host.go b/vendor/github.com/jaypipes/ghw/host.go index 5d82a53a..89b1ad27 100644 --- a/vendor/github.com/jaypipes/ghw/host.go +++ b/vendor/github.com/jaypipes/ghw/host.go @@ -11,6 +11,7 @@ import ( "github.com/jaypipes/ghw/pkg/context" + "github.com/jaypipes/ghw/pkg/accelerator" "github.com/jaypipes/ghw/pkg/baseboard" "github.com/jaypipes/ghw/pkg/bios" "github.com/jaypipes/ghw/pkg/block" @@ -28,18 +29,19 @@ import ( // HostInfo is a wrapper struct containing information about the host system's // memory, block storage, CPU, etc type HostInfo struct { - ctx *context.Context - Memory *memory.Info `json:"memory"` - Block *block.Info `json:"block"` - CPU *cpu.Info `json:"cpu"` - Topology *topology.Info `json:"topology"` - Network *net.Info `json:"network"` - GPU *gpu.Info `json:"gpu"` - Chassis *chassis.Info `json:"chassis"` - BIOS *bios.Info `json:"bios"` - Baseboard *baseboard.Info `json:"baseboard"` - Product *product.Info `json:"product"` - PCI *pci.Info `json:"pci"` + ctx *context.Context + Memory *memory.Info `json:"memory"` + Block *block.Info `json:"block"` + CPU *cpu.Info `json:"cpu"` + Topology *topology.Info `json:"topology"` + Network *net.Info `json:"network"` + GPU *gpu.Info `json:"gpu"` + Accelerator *accelerator.Info `json:"accelerator"` + Chassis *chassis.Info `json:"chassis"` + BIOS *bios.Info `json:"bios"` + Baseboard *baseboard.Info `json:"baseboard"` + Product *product.Info `json:"product"` + PCI *pci.Info `json:"pci"` } // Host returns a pointer to a HostInfo struct that contains fields with @@ -71,6 +73,10 @@ func Host(opts ...*WithOption) (*HostInfo, error) { if err != nil { return nil, err } + acceleratorInfo, err := accelerator.New(opts...) + if err != nil { + return nil, err + } chassisInfo, err := chassis.New(opts...) if err != nil { return nil, err @@ -92,18 +98,19 @@ func Host(opts ...*WithOption) (*HostInfo, error) { return nil, err } return &HostInfo{ - ctx: ctx, - CPU: cpuInfo, - Memory: memInfo, - Block: blockInfo, - Topology: topologyInfo, - Network: netInfo, - GPU: gpuInfo, - Chassis: chassisInfo, - BIOS: biosInfo, - Baseboard: baseboardInfo, - Product: productInfo, - PCI: pciInfo, + ctx: ctx, + CPU: cpuInfo, + Memory: memInfo, + Block: blockInfo, + Topology: topologyInfo, + Network: netInfo, + GPU: gpuInfo, + Accelerator: acceleratorInfo, + Chassis: chassisInfo, + BIOS: biosInfo, + Baseboard: baseboardInfo, + Product: productInfo, + PCI: pciInfo, }, nil } @@ -111,10 +118,11 @@ func Host(opts ...*WithOption) (*HostInfo, error) { // structs' String-ified output func (info *HostInfo) String() string { return fmt.Sprintf( - "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", info.Block.String(), info.CPU.String(), info.GPU.String(), + info.Accelerator.String(), info.Memory.String(), info.Network.String(), info.Topology.String(), diff --git a/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator.go b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator.go new file mode 100644 index 00000000..b51ef2e2 --- /dev/null +++ b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator.go @@ -0,0 +1,84 @@ +// +// Use and distribution licensed under the Apache license version 2. +// +// See the COPYING file in the root project directory for full text. +// + +package accelerator + +import ( + "fmt" + + "github.com/jaypipes/ghw/pkg/context" + "github.com/jaypipes/ghw/pkg/marshal" + "github.com/jaypipes/ghw/pkg/option" + "github.com/jaypipes/ghw/pkg/pci" +) + +type AcceleratorDevice struct { + // the PCI address where the accelerator device can be found + Address string `json:"address"` + // pointer to a PCIDevice struct that describes the vendor and product + // model, etc + PCIDevice *pci.Device `json:"pci_device"` +} + +func (dev *AcceleratorDevice) String() string { + deviceStr := dev.Address + if dev.PCIDevice != nil { + deviceStr = dev.PCIDevice.String() + } + nodeStr := "" + return fmt.Sprintf( + "device %s@%s", + nodeStr, + deviceStr, + ) +} + +type Info struct { + ctx *context.Context + Devices []*AcceleratorDevice `json:"devices"` +} + +// New returns a pointer to an Info struct that contains information about the +// accelerator devices on the host system +func New(opts ...*option.Option) (*Info, error) { + ctx := context.New(opts...) + info := &Info{ctx: ctx} + + if err := ctx.Do(info.load); err != nil { + return nil, err + } + return info, nil +} + +func (i *Info) String() string { + numDevsStr := "devices" + if len(i.Devices) == 1 { + numDevsStr = "device" + } + return fmt.Sprintf( + "processing accelerators (%d %s)", + len(i.Devices), + numDevsStr, + ) +} + +// simple private struct used to encapsulate processing accelerators information in a top-level +// "accelerator" YAML/JSON map/object key +type acceleratorPrinter struct { + Info *Info `json:"accelerator"` +} + +// YAMLString returns a string with the processing accelerators information formatted as YAML +// under a top-level "accelerator:" key +func (i *Info) YAMLString() string { + return marshal.SafeYAML(i.ctx, acceleratorPrinter{i}) +} + +// JSONString returns a string with the processing accelerators information formatted as JSON +// under a top-level "accelerator:" key +func (i *Info) JSONString(indent bool) string { + return marshal.SafeJSON(i.ctx, acceleratorPrinter{i}, indent) +} diff --git a/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_linux.go b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_linux.go new file mode 100644 index 00000000..39d7eecb --- /dev/null +++ b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_linux.go @@ -0,0 +1,80 @@ +// Use and distribution licensed under the Apache license version 2. +// +// See the COPYING file in the root project directory for full text. +// + +package accelerator + +import ( + "github.com/jaypipes/ghw/pkg/context" + "github.com/jaypipes/ghw/pkg/pci" +) + +// PCI IDs list available at https://admin.pci-ids.ucw.cz/read/PD +const ( + pciClassProcessingAccelerator = "12" + pciSubclassProcessingAccelerator = "00" + pciClassController = "03" + pciSubclass3DController = "02" + pciSubclassDisplayController = "80" +) + +var ( + acceleratorPCIClasses = map[string][]string{ + pciClassProcessingAccelerator: []string{ + pciSubclassProcessingAccelerator, + }, + pciClassController: []string{ + pciSubclass3DController, + pciSubclassDisplayController, + }, + } +) + +func (i *Info) load() error { + accelDevices := make([]*AcceleratorDevice, 0) + + // get PCI devices + pciInfo, err := pci.New(context.WithContext(i.ctx)) + if err != nil { + i.ctx.Warn("error loading PCI information: %s", err) + return nil + } + + // Prepare hardware filter based in the PCI Class + Subclass + isAccelerator := func(dev *pci.Device) bool { + class := dev.Class.ID + subclass := dev.Subclass.ID + if subclasses, ok := acceleratorPCIClasses[class]; ok { + if slicesContains(subclasses, subclass) { + return true + } + } + return false + } + + // This loop iterates over the list of PCI devices and filters them based on discovery criteria + for _, device := range pciInfo.Devices { + if !isAccelerator(device) { + continue + } + accelDev := &AcceleratorDevice{ + Address: device.Address, + PCIDevice: device, + } + accelDevices = append(accelDevices, accelDev) + } + + i.Devices = accelDevices + return nil +} + +// TODO: delete and just use slices.Contains when the minimal golang version we support is 1.21 +func slicesContains(s []string, v string) bool { + for i := range s { + if v == s[i] { + return true + } + } + return false +} diff --git a/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_stub.go b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_stub.go new file mode 100644 index 00000000..7e0b9fd4 --- /dev/null +++ b/vendor/github.com/jaypipes/ghw/pkg/accelerator/accelerator_stub.go @@ -0,0 +1,19 @@ +//go:build !linux +// +build !linux + +// Use and distribution licensed under the Apache license version 2. +// +// See the COPYING file in the root project directory for full text. +// + +package accelerator + +import ( + "runtime" + + "github.com/pkg/errors" +) + +func (i *Info) load() error { + return errors.New("accelerator.Info.load not implemented on " + runtime.GOOS) +} diff --git a/vendor/github.com/jaypipes/ghw/pkg/block/block_linux.go b/vendor/github.com/jaypipes/ghw/pkg/block/block_linux.go index 376b5ff5..3542bd72 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/block/block_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/block/block_linux.go @@ -208,6 +208,10 @@ func diskWWN(paths *linuxpath.Paths, disk string) string { if wwn, ok := info["ID_WWN"]; ok { return wwn } + // Device Mapper devices get DM_WWN instead of ID_WWN_WITH_EXTENSION + if wwn, ok := info["DM_WWN"]; ok { + return wwn + } return util.UNKNOWN } diff --git a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu.go b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu.go index 4865b46d..5c5e6bab 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu.go +++ b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu.go @@ -23,7 +23,11 @@ type ProcessorCore struct { // within a physical package. For example, the core IDs for an Intel Core // i7 are 0, 1, 2, 8, 9, and 10 ID int `json:"id"` - // NumThreads is the number of hardware threads associated with the core + // TotalHardwareThreads is the number of hardware threads associated with + // the core + TotalHardwareThreads uint32 `json:"total_hardware_threads"` + // NumThreads is the number of hardware threads associated with the core. + // DEPRECATED: Use `TotalHardwareThreads` instead. NumThreads uint32 `json:"total_threads"` // LogicalProcessors is a slice of ints representing the logical processor // IDs assigned to any processing unit for the core. These are sometimes @@ -38,7 +42,7 @@ func (c *ProcessorCore) String() string { return fmt.Sprintf( "processor core #%d (%d threads), logical processors %v", c.ID, - c.NumThreads, + c.TotalHardwareThreads, c.LogicalProcessors, ) } @@ -47,9 +51,16 @@ func (c *ProcessorCore) String() string { type Processor struct { // ID is the physical processor `uint32` ID according to the system ID int `json:"id"` + // TotalCores is the number of physical cores in the processor package + TotalCores uint32 `json:"total_cores"` // NumCores is the number of physical cores in the processor package - NumCores uint32 `json:"total_cores"` + // DEPRECATED: Use `TotalCores` instead. + NumCores uint32 `json:"-"` + // TotalHardwareThreads is the number of hardware threads associated with + // the processor package + TotalHardwareThreads uint32 `json:"total_hardware_threads"` // NumThreads is the number of hardware threads in the processor package + // DEPRECATED: Use `TotalHardwareThreads` instead. NumThreads uint32 `json:"total_threads"` // Vendor is a string containing the vendor name Vendor string `json:"vendor"` @@ -91,19 +102,19 @@ func (p *Processor) HasCapability(find string) bool { // String returns a short string describing the Processor func (p *Processor) String() string { ncs := "cores" - if p.NumCores == 1 { + if p.TotalCores == 1 { ncs = "core" } nts := "threads" - if p.NumThreads == 1 { + if p.TotalHardwareThreads == 1 { nts = "thread" } return fmt.Sprintf( "physical package #%d (%d %s, %d hardware %s)", p.ID, - p.NumCores, + p.TotalCores, ncs, - p.NumThreads, + p.TotalHardwareThreads, nts, ) } @@ -117,6 +128,10 @@ type Info struct { TotalCores uint32 `json:"total_cores"` // TotalThreads is the total number of hardware threads the host system // contains + TotalHardwareThreads uint32 `json:"total_hardware_threads"` + // TotalThreads is the total number of hardware threads the host system + // contains + // DEPRECATED: Use `TotalHardwareThreads` instead TotalThreads uint32 `json:"total_threads"` // Processors is a slice of Processor struct pointers, one for each // physical processor package contained in the host diff --git a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_darwin.go b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_darwin.go index 7e9e8fc7..e4353e47 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_darwin.go +++ b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_darwin.go @@ -84,6 +84,9 @@ func populateSysctlOutput() error { for _, l := range oS { if l != "" { s := strings.SplitN(l, ":", 2) + if len(s) < 2 { + continue + } k, v := strings.TrimSpace(s[0]), strings.TrimSpace(s[1]) sysctlOutput[k] = v diff --git a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_linux.go b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_linux.go index 3ec2e847..f403d29d 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_linux.go @@ -7,6 +7,7 @@ package cpu import ( "bufio" + "errors" "fmt" "os" "path/filepath" @@ -30,10 +31,12 @@ func (i *Info) load() error { var totCores uint32 var totThreads uint32 for _, p := range i.Processors { - totCores += p.NumCores - totThreads += p.NumThreads + totCores += p.TotalCores + totThreads += p.TotalHardwareThreads } i.TotalCores = totCores + i.TotalHardwareThreads = totThreads + // TODO(jaypipes): Remove TotalThreads before v1.0 i.TotalThreads = totThreads return nil } @@ -66,8 +69,13 @@ func processorsGet(ctx *context.Context) []*Processor { } onlineFilePath := filepath.Join(paths.SysDevicesSystemCPU, fmt.Sprintf("cpu%d", lpID), onlineFile) - if util.SafeIntFromFile(ctx, onlineFilePath) == 0 { - continue + if _, err := os.Stat(onlineFilePath); err == nil { + if util.SafeIntFromFile(ctx, onlineFilePath) == 0 { + continue + } + } else if errors.Is(err, os.ErrNotExist) { + // Assume the CPU is online if the online state file doesn't exist + // (as is the case with older snapshots) } procID := processorIDFromLogicalProcessorID(ctx, lpID) proc, found := procs[procID] @@ -93,6 +101,12 @@ func processorsGet(ctx *context.Context) []*Processor { } if len(lp.Attrs["model name"]) != 0 { proc.Model = lp.Attrs["model name"] + } else if len(lp.Attrs["Processor"]) != 0 { // ARM + proc.Model = lp.Attrs["Processor"] + } else if len(lp.Attrs["cpu model"]) != 0 { // MIPS, ARM + proc.Model = lp.Attrs["cpu model"] + } else if len(lp.Attrs["Model Name"]) != 0 { // LoongArch + proc.Model = lp.Attrs["Model Name"] } else if len(lp.Attrs["uarch"]) != 0 { // SiFive proc.Model = lp.Attrs["uarch"] } @@ -100,6 +114,8 @@ func processorsGet(ctx *context.Context) []*Processor { proc.Vendor = lp.Attrs["vendor_id"] } else if len(lp.Attrs["isa"]) != 0 { // RISCV64 proc.Vendor = lp.Attrs["isa"] + } else if lp.Attrs["CPU implementer"] == "0x41" { // ARM + proc.Vendor = "ARM" } procs[procID] = proc } @@ -107,12 +123,23 @@ func processorsGet(ctx *context.Context) []*Processor { coreID := coreIDFromLogicalProcessorID(ctx, lpID) core := proc.CoreByID(coreID) if core == nil { - core = &ProcessorCore{ID: coreID, NumThreads: 1} + core = &ProcessorCore{ + ID: coreID, + TotalHardwareThreads: 1, + // TODO(jaypipes): Remove NumThreads before v1.0 + NumThreads: 1, + } proc.Cores = append(proc.Cores, core) + proc.TotalCores += 1 + // TODO(jaypipes): Remove NumCores before v1.0 proc.NumCores += 1 } else { + core.TotalHardwareThreads += 1 + // TODO(jaypipes) Remove NumThreads before v1.0 core.NumThreads += 1 } + proc.TotalHardwareThreads += 1 + // TODO(jaypipes) Remove NumThreads before v1.0 proc.NumThreads += 1 core.LogicalProcessors = append(core.LogicalProcessors, lpID) } @@ -207,8 +234,13 @@ func CoresForNode(ctx *context.Context, nodeID int) ([]*ProcessorCore, error) { continue } onlineFilePath := filepath.Join(cpuPath, onlineFile) - if util.SafeIntFromFile(ctx, onlineFilePath) == 0 { - continue + if _, err := os.Stat(onlineFilePath); err == nil { + if util.SafeIntFromFile(ctx, onlineFilePath) == 0 { + continue + } + } else if errors.Is(err, os.ErrNotExist) { + // Assume the CPU is online if the online state file doesn't exist + // (as is the case with older snapshots) } coreIDPath := filepath.Join(cpuPath, "topology", "core_id") coreID := util.SafeIntFromFile(ctx, coreIDPath) @@ -220,7 +252,9 @@ func CoresForNode(ctx *context.Context, nodeID int) ([]*ProcessorCore, error) { } for _, c := range cores { - c.NumThreads = uint32(len(c.LogicalProcessors)) + c.TotalHardwareThreads = uint32(len(c.LogicalProcessors)) + // TODO(jaypipes): Remove NumThreads before v1.0 + c.NumThreads = c.TotalHardwareThreads } return cores, nil diff --git a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_windows.go b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_windows.go index 3de16498..bd4b8469 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_windows.go +++ b/vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_windows.go @@ -32,10 +32,12 @@ func (i *Info) load() error { var totCores uint32 var totThreads uint32 for _, p := range i.Processors { - totCores += p.NumCores - totThreads += p.NumThreads + totCores += p.TotalCores + totThreads += p.TotalHardwareThreads } i.TotalCores = totCores + i.TotalHardwareThreads = totThreads + // TODO(jaypipes): Remove TotalThreads by v1.0 i.TotalThreads = totThreads return nil } @@ -48,7 +50,11 @@ func processorsGet(win32descriptions []win32Processor) []*Processor { ID: index, Model: *description.Name, Vendor: *description.Manufacturer, - NumCores: description.NumberOfCores, + TotalCores: description.NumberOfCores, + // TODO(jaypipes): Remove NumCores before v1.0 + NumCores: description.NumberOfCores, + TotalHardwareThreads: description.NumberOfLogicalProcessors, + // TODO(jaypipes): Remove NumThreads before v1.0 NumThreads: description.NumberOfLogicalProcessors, } procs = append(procs, p) diff --git a/vendor/github.com/jaypipes/ghw/pkg/gpu/gpu_linux.go b/vendor/github.com/jaypipes/ghw/pkg/gpu/gpu_linux.go index 8f9c9b8c..e5e341c1 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/gpu/gpu_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/gpu/gpu_linux.go @@ -8,6 +8,7 @@ package gpu import ( "os" "path/filepath" + "regexp" "strconv" "strings" @@ -18,6 +19,12 @@ import ( "github.com/jaypipes/ghw/pkg/util" ) +const ( + validPCIAddress = `\b(0{0,4}:\d{2}:\d{2}.\d:?\w*)` +) + +var reValidPCIAddress = regexp.MustCompile(validPCIAddress) + const ( _WARN_NO_SYS_CLASS_DRM = ` /sys/class/drm does not exist on this system (likely the host system is a @@ -83,8 +90,19 @@ func (i *Info) load() error { continue } pathParts := strings.Split(dest, "/") - numParts := len(pathParts) - pciAddress := pathParts[numParts-3] + // The PCI address of the graphics card is the *last* PCI address in + // the filepath... + pciAddress := "" + for x := len(pathParts) - 1; x >= 0; x-- { + part := pathParts[x] + if reValidPCIAddress.MatchString(part) { + pciAddress = part + break + } + } + if pciAddress == "" { + continue + } card := &GraphicsCard{ Address: pciAddress, Index: cardIdx, @@ -102,6 +120,7 @@ func (i *Info) load() error { func gpuFillPCIDevice(ctx *context.Context, cards []*GraphicsCard) { pci, err := pci.New(context.WithContext(ctx)) if err != nil { + ctx.Warn("failed to PCI device database: %s", err) return } for _, card := range cards { @@ -121,7 +140,7 @@ func gpuFillNUMANodes(ctx *context.Context, cards []*GraphicsCard) { // Problem getting topology information so just set the graphics card's // node to nil for _, card := range cards { - if topo.Architecture != topology.ARCHITECTURE_NUMA { + if topo.Architecture != topology.ArchitectureNUMA { card.Node = nil } } diff --git a/vendor/github.com/jaypipes/ghw/pkg/memory/memory.go b/vendor/github.com/jaypipes/ghw/pkg/memory/memory.go index 81e0dc66..f58ba8b9 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/memory/memory.go +++ b/vendor/github.com/jaypipes/ghw/pkg/memory/memory.go @@ -29,6 +29,15 @@ type Module struct { Vendor string `json:"vendor"` } +// HugePageAmounts describes huge page info +type HugePageAmounts struct { + Total int64 `json:"total"` + Free int64 `json:"free"` + Surplus int64 `json:"surplus"` + // Note: this field will not be populated for Topology call, since data not present in NUMA folder structure + Reserved int64 `json:"reserved"` +} + // Area describes a set of physical memory on a host system. Non-NUMA systems // will almost always have a single memory area containing all memory the // system can use. NUMA systems will have multiple memory areas, one or more @@ -37,8 +46,14 @@ type Area struct { TotalPhysicalBytes int64 `json:"total_physical_bytes"` TotalUsableBytes int64 `json:"total_usable_bytes"` // An array of sizes, in bytes, of memory pages supported in this area - SupportedPageSizes []uint64 `json:"supported_page_sizes"` - Modules []*Module `json:"modules"` + SupportedPageSizes []uint64 `json:"supported_page_sizes"` + // Default system huge page size, in bytes + DefaultHugePageSize uint64 `json:"default_huge_page_size"` + // Amount of memory, in bytes, consumed by huge pages of all sizes + TotalHugePageBytes int64 `json:"total_huge_page_bytes"` + // Huge page info by size + HugePageAmountsBySize map[uint64]*HugePageAmounts `json:"huge_page_amounts_by_size"` + Modules []*Module `json:"modules"` } // String returns a short string with a summary of information for this memory diff --git a/vendor/github.com/jaypipes/ghw/pkg/memory/memory_linux.go b/vendor/github.com/jaypipes/ghw/pkg/memory/memory_linux.go index d5a54101..53acfd5c 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/memory/memory_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/memory/memory_linux.go @@ -11,6 +11,7 @@ import ( "fmt" "io" "os" + "path" "path/filepath" "regexp" "strconv" @@ -57,6 +58,17 @@ func (i *Info) load() error { i.TotalPhysicalBytes = tub } i.SupportedPageSizes, _ = memorySupportedPageSizes(paths.SysKernelMMHugepages) + i.DefaultHugePageSize, _ = memoryDefaultHPSizeFromPath(paths.ProcMeminfo) + i.TotalHugePageBytes, _ = memoryHugeTLBFromPath(paths.ProcMeminfo) + hugePageAmounts := make(map[uint64]*HugePageAmounts) + for _, p := range i.SupportedPageSizes { + info, err := memoryHPInfo(paths.SysKernelMMHugepages, p) + if err != nil { + return err + } + hugePageAmounts[p] = info + } + i.HugePageAmountsBySize = hugePageAmounts return nil } @@ -99,10 +111,32 @@ func AreaForNode(ctx *context.Context, nodeID int) (*Area, error) { return nil, err } + defHPSize, err := memoryDefaultHPSizeFromPath(paths.ProcMeminfo) + if err != nil { + return nil, err + } + + totHPSize, err := memoryHugeTLBFromPath(paths.ProcMeminfo) + if err != nil { + return nil, err + } + + hugePageAmounts := make(map[uint64]*HugePageAmounts) + for _, p := range supportedHP { + info, err := memoryHPInfo(filepath.Join(path, "hugepages"), p) + if err != nil { + return nil, err + } + hugePageAmounts[p] = info + } + return &Area{ - TotalPhysicalBytes: totPhys, - TotalUsableBytes: totUsable, - SupportedPageSizes: supportedHP, + TotalPhysicalBytes: totPhys, + TotalUsableBytes: totUsable, + SupportedPageSizes: supportedHP, + DefaultHugePageSize: defHPSize, + TotalHugePageBytes: totHPSize, + HugePageAmountsBySize: hugePageAmounts, }, nil } @@ -243,7 +277,113 @@ func memTotalUsableBytes(paths *linuxpath.Paths) int64 { return amount } +func memorySupportedPageSizes(hpDir string) ([]uint64, error) { + // In Linux, /sys/kernel/mm/hugepages contains a directory per page size + // supported by the kernel. The directory name corresponds to the pattern + // 'hugepages-{pagesize}kb' + out := make([]uint64, 0) + + files, err := os.ReadDir(hpDir) + if err != nil { + return out, err + } + for _, file := range files { + parts := strings.Split(file.Name(), "-") + sizeStr := parts[1] + // Cut off the 'kb' + sizeStr = sizeStr[0 : len(sizeStr)-2] + size, err := strconv.Atoi(sizeStr) + if err != nil { + return out, err + } + out = append(out, uint64(size*int(unitutil.KB))) + } + return out, nil +} + +func memoryHPInfo(hpDir string, sizeBytes uint64) (*HugePageAmounts, error) { + // In linux huge page info can be obtained in several places + // /sys/kernel/mm/hugepages/hugepages-{pagesize}kb/ directory, which contains + // nr_hugepages + // nr_hugepages_mempolicy + // nr_overcommit_hugepages + // free_hugepages + // resv_hugepages + // surplus_hugepages + // or NUMA specific data /sys/devices/system/node/node[0-9]*/hugepages/hugepages-{pagesize}kb/, which contains + // nr_hugepages + // free_hugepages + // surplus_hugepages + targetPath := filepath.Join(hpDir, fmt.Sprintf("hugepages-%vkB", sizeBytes/uint64(unitutil.KB))) + files, err := os.ReadDir(targetPath) + if err != nil { + return nil, err + } + + var ( + total int64 + free int64 + surplus int64 + reserved int64 + ) + + for _, f := range files { + switch f.Name() { + case "nr_hugepages": + count, err := readFileToInt64(path.Join(targetPath, f.Name())) + if err != nil { + return nil, err + } + total = count + case "free_hugepages": + count, err := readFileToInt64(path.Join(targetPath, f.Name())) + if err != nil { + return nil, err + } + free = count + case "surplus_hugepages": + count, err := readFileToInt64(path.Join(targetPath, f.Name())) + if err != nil { + return nil, err + } + surplus = count + case "resv_hugepages": + count, err := readFileToInt64(path.Join(targetPath, f.Name())) + if err != nil { + return nil, err + } + reserved = count + } + } + + return &HugePageAmounts{ + Total: total, + Free: free, + Surplus: surplus, + Reserved: reserved, + }, nil +} + func memoryTotalUsableBytesFromPath(meminfoPath string) (int64, error) { + const key = "MemTotal" + return getMemInfoField(meminfoPath, key) +} + +func memoryDefaultHPSizeFromPath(meminfoPath string) (uint64, error) { + const key = "Hugepagesize" + got, err := getMemInfoField(meminfoPath, key) + if err != nil { + return 0, err + } + return uint64(got), nil +} + +func memoryHugeTLBFromPath(meminfoPath string) (int64, error) { + const key = "Hugetlb" + return getMemInfoField(meminfoPath, key) +} + +func getMemInfoField(meminfoPath string, wantKey string) (int64, error) { // In Linux, /proc/meminfo or its close relative // /sys/devices/system/node/node*/meminfo // contains a set of memory-related amounts, with @@ -280,7 +420,7 @@ func memoryTotalUsableBytesFromPath(meminfoPath string) (int64, error) { line := scanner.Text() parts := strings.Split(line, ":") key := parts[0] - if !strings.Contains(key, "MemTotal") { + if !strings.Contains(key, wantKey) { continue } rawValue := parts[1] @@ -294,29 +434,13 @@ func memoryTotalUsableBytesFromPath(meminfoPath string) (int64, error) { } return int64(value), nil } - return -1, fmt.Errorf("failed to find MemTotal entry in path %q", meminfoPath) + return -1, fmt.Errorf("failed to find '%s' entry in path %q", wantKey, meminfoPath) } -func memorySupportedPageSizes(hpDir string) ([]uint64, error) { - // In Linux, /sys/kernel/mm/hugepages contains a directory per page size - // supported by the kernel. The directory name corresponds to the pattern - // 'hugepages-{pagesize}kb' - out := make([]uint64, 0) - - files, err := os.ReadDir(hpDir) +func readFileToInt64(filename string) (int64, error) { + data, err := os.ReadFile(filename) if err != nil { - return out, err - } - for _, file := range files { - parts := strings.Split(file.Name(), "-") - sizeStr := parts[1] - // Cut off the 'kb' - sizeStr = sizeStr[0 : len(sizeStr)-2] - size, err := strconv.Atoi(sizeStr) - if err != nil { - return out, err - } - out = append(out, uint64(size*int(unitutil.KB))) + return -1, err } - return out, nil + return strconv.ParseInt(strings.TrimSpace(string(data)), 10, 64) } diff --git a/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go b/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go index 49adde62..55cc1eac 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go +++ b/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go @@ -135,7 +135,7 @@ func New(opts ...*option.Option) (*Info, error) { // by default we don't report NUMA information; // we will only if are sure we are running on NUMA architecture info := &Info{ - arch: topology.ARCHITECTURE_SMP, + arch: topology.ArchitectureSMP, ctx: ctx, } diff --git a/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go b/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go index 538e77f3..a9616687 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go @@ -325,7 +325,7 @@ func (info *Info) GetDevice(address string) *Device { device := info.getDeviceFromModaliasInfo(address, modaliasInfo) device.Revision = getDeviceRevision(info.ctx, pciAddr) - if info.arch == topology.ARCHITECTURE_NUMA { + if info.arch == topology.ArchitectureNUMA { device.Node = getDeviceNUMANode(info.ctx, pciAddr) } device.Driver = getDeviceDriver(info.ctx, pciAddr) diff --git a/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_linux.go b/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_linux.go index 68fdeceb..8191e80c 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_linux.go @@ -42,6 +42,7 @@ func ExpectedCloneStaticContent() []string { "/sys/devices/system/node/online", "/sys/devices/system/node/possible", "/sys/devices/system/node/node*/cpu*", + "/sys/devices/system/node/node*/cpu*/online", "/sys/devices/system/node/node*/distance", "/sys/devices/system/node/node*/meminfo", "/sys/devices/system/node/node*/memory*", diff --git a/vendor/github.com/jaypipes/ghw/pkg/snapshot/pack.go b/vendor/github.com/jaypipes/ghw/pkg/snapshot/pack.go index 94b5bb69..73820c94 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/snapshot/pack.go +++ b/vendor/github.com/jaypipes/ghw/pkg/snapshot/pack.go @@ -14,7 +14,6 @@ import ( "io" "os" "path/filepath" - "strings" ) // PackFrom creates the snapshot named `snapshotName` from the @@ -33,27 +32,22 @@ func PackFrom(snapshotName, sourceRoot string) error { // if the file seems to exist and have existing content already. // This is done to avoid accidental overwrites. func OpenDestination(snapshotName string) (*os.File, error) { - var f *os.File - var err error - - if _, err = os.Stat(snapshotName); errors.Is(err, os.ErrNotExist) { - if f, err = os.Create(snapshotName); err != nil { + f, err := os.OpenFile(snapshotName, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600) + if err != nil { + if !errors.Is(err, os.ErrExist) { return nil, err } - } else if err != nil { - return nil, err - } else { - f, err := os.OpenFile(snapshotName, os.O_WRONLY, 0600) + fs, err := os.Stat(snapshotName) if err != nil { return nil, err } - fs, err := f.Stat() + if fs.Size() > 0 { + return nil, fmt.Errorf("file %s already exists and is of size > 0", snapshotName) + } + f, err = os.OpenFile(snapshotName, os.O_WRONLY, 0600) if err != nil { return nil, err } - if fs.Size() > 0 { - return nil, fmt.Errorf("File %s already exists and is of size >0", snapshotName) - } } return f, nil } @@ -91,7 +85,11 @@ func createSnapshot(tw *tar.Writer, buildDir string) error { if err != nil { return err } - hdr.Name = strings.TrimPrefix(strings.TrimPrefix(path, buildDir), string(os.PathSeparator)) + relPath, err := filepath.Rel(buildDir, path) + if err != nil { + return err + } + hdr.Name = relPath if err = tw.WriteHeader(hdr); err != nil { return err @@ -103,10 +101,10 @@ func createSnapshot(tw *tar.Writer, buildDir string) error { if err != nil { return err } + defer f.Close() if _, err = io.Copy(tw, f); err != nil { return err } - f.Close() } return nil }) diff --git a/vendor/github.com/jaypipes/ghw/pkg/topology/topology.go b/vendor/github.com/jaypipes/ghw/pkg/topology/topology.go index 4a269bb9..0210ab48 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/topology/topology.go +++ b/vendor/github.com/jaypipes/ghw/pkg/topology/topology.go @@ -26,15 +26,24 @@ type Architecture int const ( // SMP is a Symmetric Multi-Processor system - ARCHITECTURE_SMP Architecture = iota + ArchitectureSMP Architecture = iota // NUMA is a Non-Uniform Memory Access system - ARCHITECTURE_NUMA + ArchitectureNUMA +) + +const ( + // DEPRECATED: please use ArchitectureSMP. + // TODO(jaypipes): Remove before v1.0 + ARCHITECTURE_SMP = ArchitectureSMP + // DEPRECATED: please use ArchitectureNUMA. + // TODO(jaypipes): Remove before v1.0 + ARCHITECTURE_NUMA = ArchitectureNUMA ) var ( architectureString = map[Architecture]string{ - ARCHITECTURE_SMP: "SMP", - ARCHITECTURE_NUMA: "NUMA", + ArchitectureSMP: "SMP", + ArchitectureNUMA: "NUMA", } // NOTE(fromani): the keys are all lowercase and do not match @@ -43,8 +52,8 @@ var ( // Architecture:MarshalJSON. // We use this table only in UnmarshalJSON, so it should be OK. stringArchitecture = map[string]Architecture{ - "smp": ARCHITECTURE_SMP, - "numa": ARCHITECTURE_NUMA, + "smp": ArchitectureSMP, + "numa": ArchitectureNUMA, } ) @@ -126,7 +135,7 @@ func New(opts ...*option.Option) (*Info, error) { func (i *Info) String() string { archStr := "SMP" - if i.Architecture == ARCHITECTURE_NUMA { + if i.Architecture == ArchitectureNUMA { archStr = "NUMA" } res := fmt.Sprintf( diff --git a/vendor/github.com/jaypipes/ghw/pkg/topology/topology_linux.go b/vendor/github.com/jaypipes/ghw/pkg/topology/topology_linux.go index 9d8434cb..dbd0811e 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/topology/topology_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/topology/topology_linux.go @@ -21,9 +21,9 @@ import ( func (i *Info) load() error { i.Nodes = topologyNodes(i.ctx) if len(i.Nodes) == 1 { - i.Architecture = ARCHITECTURE_SMP + i.Architecture = ArchitectureSMP } else { - i.Architecture = ARCHITECTURE_NUMA + i.Architecture = ArchitectureNUMA } return nil } diff --git a/vendor/github.com/jaypipes/ghw/pkg/topology/topology_windows.go b/vendor/github.com/jaypipes/ghw/pkg/topology/topology_windows.go index 3141ac99..2991aaa9 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/topology/topology_windows.go +++ b/vendor/github.com/jaypipes/ghw/pkg/topology/topology_windows.go @@ -31,9 +31,9 @@ func (i *Info) load() error { } i.Nodes = nodes if len(nodes) == 1 { - i.Architecture = ARCHITECTURE_SMP + i.Architecture = ArchitectureSMP } else { - i.Architecture = ARCHITECTURE_NUMA + i.Architecture = ArchitectureNUMA } return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 43a629dc..67dc69e4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -59,9 +59,10 @@ github.com/hashicorp/hcl/hcl/token github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token -# github.com/jaypipes/ghw v0.13.0 +# github.com/jaypipes/ghw v0.16.0 ## explicit; go 1.21 github.com/jaypipes/ghw +github.com/jaypipes/ghw/pkg/accelerator github.com/jaypipes/ghw/pkg/baseboard github.com/jaypipes/ghw/pkg/bios github.com/jaypipes/ghw/pkg/block