MCPcopy
hub / github.com/jaypipes/ghw / getDeviceRevision

Function getDeviceRevision

pkg/pci/pci_linux.go:52–67  ·  view source on GitHub ↗
(paths *linuxpath.Paths, pciAddr *pciaddr.Address)

Source from the content-addressed store, hash-verified

50}
51
52func getDeviceRevision(paths *linuxpath.Paths, pciAddr *pciaddr.Address) string {
53 revisionPath := filepath.Join(
54 paths.SysBusPciDevices,
55 pciAddr.String(),
56 "revision",
57 )
58
59 if _, err := os.Stat(revisionPath); err != nil {
60 return ""
61 }
62 revision, err := os.ReadFile(revisionPath)
63 if err != nil {
64 return ""
65 }
66 return strings.TrimSpace(string(revision))
67}
68
69func getDeviceNUMANode(ctx context.Context, pciAddr *pciaddr.Address) *topology.Node {
70 paths := linuxpath.New(ctx)

Callers 1

getDevicesMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…