Skip to content

snapshot: capture the DeviceTree properties ghw reads - #481

Merged
jaypipes merged 2 commits into
jaypipes:mainfrom
rucoder:fix/snapshot-devicetree
Nov 6, 2026
Merged

jaypipes merged 2 commits into
jaypipes:mainfrom
rucoder:fix/snapshot-devicetree

Conversation

@rucoder

@rucoder rucoder commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

On a board without DMI, ghw takes the CPU model, the baseboard and chassis information, and the U-Boot version from the DeviceTree under /sys/firmware/devicetree/base (pkg/linuxdt). A snapshot captures none of these files. I took a snapshot of a Jetson AGX Orin: it reported an empty CPU model, where the board itself reports nvidia,tegra234.

This adds compatible, model, chassis-type and chosen/u-boot,version to the static snapshot content. serial-number is left out on purpose: like the MAC addresses, which the snapshot already skips, it identifies the board.

TestCloneDeviceTree builds a DeviceTree in a scratch root, clones it with the snapshot's own patterns, and reads Model, Vendor, SoC, ChassisType and UBootVersion from the clone and from the source. It requires the same results from both, and requires that the clone has no serial number. On main every value read from the clone is unknown.

On a board without DMI, ghw takes the CPU model, the baseboard and
chassis information and the U-Boot version from the DeviceTree under
/sys/firmware/devicetree/base, but a snapshot captured none of it: a
snapshot of a Jetson AGX Orin reported an empty CPU model where the
board itself reports nvidia,tegra234.

Capture compatible, model, chassis-type and chosen/u-boot,version. Like
the MAC addresses, serial-number is left out: it identifies the board.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
rucoder added a commit to zededa/ghw that referenced this pull request Oct 27, 2026
No snapshot had several cache instances at one level without kernel
IDs, or a cpu_capacity file: the s390x one has caches without IDs, but
its only shared level spans every CPU, so merging distinct instances
would go unnoticed, and the x86 ones come from kernels that report no
capacity there.

linux-arm64-nvidia-jetson-agx-orin is a Jetson AGX Orin on NVIDIA's 5.15
kernel. It reports each cluster of four Cortex-A78AE cores as a package,
so core IDs repeat across packages but not within one and are kept;
every CPU has capacity 1024, a homogeneous part; and no cache has a
kernel ID, so the three L3s, one per cluster, are told apart by the CPUs
sharing them. It is a full capture, taken from / in EVE's debug
container with this branch's ghwc plus the snapshot fixes of
jaypipes#480 and jaypipes#481, so it holds the board's network interfaces
and the DeviceTree properties ghw reads (the CPU model comes from
compatible). The NVMe namespace's IDs and two app UUIDs in
/proc/self/mounts are replaced by fake ones; ghwc reads the same
information from it as from the unscrubbed capture, and the same CPU
information as from the board.

TestARMClusterPackagesSnapshot checks the packages, CPU model, cores,
core type, frequency and caches on it.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
rucoder added a commit to zededa/ghw that referenced this pull request Oct 27, 2026
On a board without DMI, ghw takes the CPU model, the baseboard and
chassis information and the U-Boot version from the DeviceTree under
/sys/firmware/devicetree/base, but a snapshot captured none of it: a
snapshot of a Jetson AGX Orin reported an empty CPU model where the
board itself reports nvidia,tegra234.

Capture compatible, model, chassis-type and chosen/u-boot,version. Like
the MAC addresses, serial-number is left out: it identifies the board.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
(cherry picked from commit 31d9c94, jaypipes#481)
rucoder added a commit to zededa/ghw that referenced this pull request Oct 27, 2026
No snapshot had several cache instances at one level without kernel
IDs, or a cpu_capacity file: the s390x one has caches without IDs, but
its only shared level spans every CPU, so merging distinct instances
would go unnoticed, and the x86 ones come from kernels that report no
capacity there.

linux-arm64-nvidia-jetson-agx-orin is a Jetson AGX Orin on NVIDIA's 5.15
kernel. It reports each cluster of four Cortex-A78AE cores as a package,
so core IDs repeat across packages but not within one and are kept;
every CPU has capacity 1024, a homogeneous part; and no cache has a
kernel ID, so the three L3s, one per cluster, are told apart by the CPUs
sharing them. It is a full capture, taken from / in EVE's debug
container with this branch's ghwc plus the snapshot fixes of
jaypipes#480 and jaypipes#481, so it holds the board's network interfaces
and the DeviceTree properties ghw reads (the CPU model comes from
compatible). The NVMe namespace's IDs and two app UUIDs in
/proc/self/mounts are replaced by fake ones; ghwc reads the same
information from it as from the unscrubbed capture, and the same CPU
information as from the board.

TestARMClusterPackagesSnapshot checks the packages, CPU model, cores,
core type, frequency and caches on it.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
rucoder added a commit to zededa/ghw that referenced this pull request Oct 27, 2026
No snapshot had several cache instances at one level without kernel
IDs, or a cpu_capacity file: the s390x one has caches without IDs, but
its only shared level spans every CPU, so merging distinct instances
would go unnoticed, and the x86 ones come from kernels that report no
capacity there.

linux-arm64-nvidia-jetson-agx-orin is a Jetson AGX Orin on NVIDIA's 5.15
kernel. It reports each cluster of four Cortex-A78AE cores as a package,
so core IDs repeat across packages but not within one and are kept;
every CPU has capacity 1024, a homogeneous part; and no cache has a
kernel ID, so the three L3s, one per cluster, are told apart by the CPUs
sharing them. It is a full capture, taken from / in EVE's debug
container with this branch's ghwc plus the snapshot fixes of
jaypipes#480 and jaypipes#481, so it holds the board's network interfaces
and the DeviceTree properties ghw reads (the CPU model comes from
compatible). The NVMe namespace's IDs and two app UUIDs in
/proc/self/mounts are replaced by fake ones; ghwc reads the same
information from it as from the unscrubbed capture, and the same CPU
information as from the board.

TestARMClusterPackagesSnapshot checks the packages, CPU model, cores,
core type, frequency and caches on it.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Signed-off-by: Jay Pipes <jaypipes@gmail.com>

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one thank you @rucoder :)

@jaypipes
jaypipes merged commit bf1e5e9 into jaypipes:main Nov 6, 2026
15 checks passed
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.

2 participants