Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f03d7a9
Add Xeon example
Aug 27, 2026
172b973
Use the same logic for hybrid or homogenous x86 cpus
Aug 27, 2026
8dc2801
Refactor arm and riscv modules to better match x86
Aug 27, 2026
cb86292
Refactor PowerPC to match structure of other architectures
Aug 27, 2026
c954f18
Extract the common structure and display code for all cpu types
Aug 27, 2026
e9daae3
Silence clippy warning
Aug 27, 2026
c623fc2
Bump version
Aug 27, 2026
57ff439
Fix dos socket detection: treat MP Table entries as logical processor…
timw4mail Aug 28, 2026
444745a
Fix some tests broken by the refactoring effort
timw4mail Aug 28, 2026
8819eca
Add changelog entry for dos topology fix
timw4mail Aug 28, 2026
6d55948
Simplify compile guard
timw4mail Aug 28, 2026
faf046e
Separate cpuid detection from OS detection, simplify compile guards
Aug 28, 2026
ed50ece
Restore dos topology fix
Aug 28, 2026
bce3534
Add check-all recipe that runs compile checks for several build targets
Aug 28, 2026
8aa4936
Clean up more compile guards
timw4mail Aug 28, 2026
8a5a1bc
Run compile checks in CI
Aug 28, 2026
0f2f4cf
Refactor display logic to use new methods based on common patterns
Aug 28, 2026
2b95a98
Update display logic to show both cores and threads if there are mult…
Aug 28, 2026
dac38e0
Update makefile and justfile to install missing compile targets for c…
Aug 28, 2026
fdb1762
De-duplicate a bunch of os detection logic
Aug 28, 2026
fe5591e
Fix speed and topology detection for PowerPC
Aug 28, 2026
f0146ab
Share topology struct between architectures
Aug 28, 2026
a2ceaf7
Update changelog
Aug 28, 2026
3cdf951
Add Pentium 4 Northwood dump to verify detection/display of multiple …
timw4mail Aug 28, 2026
143361f
Add color to dos version
timw4mail Aug 28, 2026
eff2c64
Fix android build and add the android check to the check-all recipe
Aug 29, 2026
095b1b5
Merge branch 'develop' of git.timshomepage.net:timw4mail/rustid into …
Aug 29, 2026
feaceb7
De-duplicate common linux and android modules
Aug 29, 2026
da979e8
Look for L3 cache to distinguish Northwood from Gallatin
Aug 29, 2026
5cc6085
Add helper method for if cache has detected l3
Aug 31, 2026
354dfbf
Update changelog
Aug 31, 2026
60e9a63
Fix build warning
Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

- uses: actions/checkout@v6

- name: Compile checks
run: just check-all

- name: Run tests
run: just test-all

Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [2.1.0] — Unified topology model, multi-socket display, NetBurst Gallatin detection, and common deduplication

### Added
- **NetBurst Northwood vs. Gallatin Disambiguation via L3 Cache**: Added `disambiguate_0f_02h` to distinguish Intel NetBurst Pentium 4 (Northwood, without L3 cache) from Pentium 4 Extreme Edition / Xeon MP (Gallatin, with L3 cache) using live L3 cache detection (`Cache::has_l3()`) and model name fallback (`src/x86/vendor/intel.rs`, `src/common/cache.rs`)
- **L3 Cache Helper Method**: Added `Cache::has_l3(&self) -> bool` method to easily check whether an L3 cache level is present and non-zero (`src/common/cache.rs`)
- **DOS Colored Console Display**: Added driverless VGA text mode ANSI color rendering for 32-bit protected mode DOS (`dos32a` build, `rustid.exe`), matching output on CLI and UEFI targets; enabled `color: true` by default, added `/M` / `/MONO` flag support for monochrome output, and automatically stripped color escape sequences when output redirection to a file is detected (`src/dos_rustid.rs`, `src/x86/dos/mod.rs`)
- **Unified CPU Topology on Common Struct**: Extracted the `Topology` struct (`sockets`, `dies`, `cores`, `threads`, `speed`, `cache`) into `src/common/topology.rs` and placed `topology: Topology` directly on the shared `Cpu<E, M>` generic object across all architectures (`x86`, `ARM`, `RISC-V`, `PowerPC`) (`src/common/cpu.rs`, `src/common/topology.rs`)
- **Multi-Socket Display Support**: Added physical socket count formatting across all architectures (`x86`, `ARM`, `RISC-V`, `PowerPC`); outputs `Topology: <N> sockets, <C> cores, <T> threads` whenever physical socket count is greater than 1 or in verbose mode (`src/common/display.rs`)
- **Sysfs Socket Detection**: Added physical package ID parsing from `/sys/devices/system/cpu/cpu*/topology/physical_package_id` and `/proc/cpuinfo` `physical id` to automatically detect multi-socket systems on Linux and Android (`src/common/os/linux_sysfs.rs`)
- **Single-Core SMT Display**: `display_topology_line` now explicitly displays thread count for single-core hyperthreaded CPUs (e.g. `1 core (2 threads)`) (`src/common/display.rs`)
- **Centralized Linux & Android Sysfs Module**: Extracted sysfs cache tree traversal (`read_sysfs_cpu_cache`, `read_sysfs_cache_per_type`), `lscpu -C` cache fallback parser, and topology reader (`detect_sysfs_topology`) into a shared `linux_sysfs` module compiled under `#[cfg(any(target_os = "linux", target_os = "android"))]` (`src/common/os/linux_sysfs.rs`)
- **Common Device-Tree, Frequency, and OS Helpers**: Added pure `core`/`no_std` safe integer frequency parser `parse_frequency_mhz`, devicetree helpers (`read_devicetree_string`, `read_devicetree_u64`, `get_devicetree_compatible`, `format_compatible_pair`), CPU governor/status parsers (`parse_governor_from_str`, `parse_status_from_str`), and thread affinity iterator `for_each_logical_core` (`src/common/os/common.rs`)
- **Cross-Compilation CI & Target Checks**: Added `check-all` recipe to `justfile` and `Makefile` with auto-installation of missing `rustup` targets, and integrated target compilation checks in GitHub Actions CI covering `x86_64-unknown-uefi`, `i586-unknown-none` (DOS), `aarch64-linux-android`, `powerpc-unknown-linux-gnu`, `riscv64gc-unknown-linux-gnu`, `aarch64-unknown-linux-gnu`, and `aarch64-pc-windows-msvc` (`.github/workflows/push.yml`, `justfile`, `Makefile`)
- **ELF to LE Converter Section Handling**: Extended `elf2le` tool to match dotted ELF section names like `.rodata.*`, `.data.*`, and `.bss.*` for DOS32A protected-mode binaries (`tools/elf2le/src/main.rs`)
- **Xeon & Pentium 4 Test Fixtures**: Added dual-socket Intel Xeon E5-2470 test fixture (`examples/xeon-e5-2470.txt`) and Intel Pentium 4 Northwood CPUID dump and tests (`tests/cpuid/dump/P4Northwood.txt`, `tests/cpuid_dump_test.rs`)

### Changed
- **Deduplicated Linux & Android OS Detection**: Replaced separate `src/arm/os/android.rs` (345 lines) with unified `src/arm/os/linux.rs` guarded by `#[cfg(linux_os)]`, and consolidated duplicated sysfs and `/proc/cpuinfo` parsing logic across Linux and Android into `src/common/os/common.rs` and `src/common/os/linux_sysfs.rs` (`src/common/os/linux.rs`, `src/common/os/android.rs`)
- **Separated CPUID Discovery from OS Enrichment**: Clarified separation between pure CPUID detection and live OS hardware enrichment (`enrich_cpu`) across DOS, EFI, and OS targets (`src/x86/cpu.rs`, `src/x86/os/mod.rs`, `src/x86/efi/mod.rs`, `src/x86/dos/mod.rs`)
- **Architecture Module Alignment**: Refactored ARM, RISC-V, and PowerPC modules to follow consistent structure, shared generic CPU types, and unified display patterns (`src/arm/cpu.rs`, `src/riscv/cpu.rs`, `src/ppc/cpu.rs`, `src/ppc/micro_arch.rs`)
- **Release Workflow Cleanup**: Configured release workflow to clean untracked/dirty files before crates.io packaging and publishing (`.github/workflows/release.yml`)

### Fixed
- **PowerPC Clock Speed Detection**: Fixed clock speed reporting on Linux PowerPC (e.g. PowerBook G4 / PowerBook5,2) by prioritizing `/proc/cpuinfo` `clock: <N>MHz`, sysfs `cpufreq`, and CPU node devicetree clock (`/proc/device-tree/cpus/*/clock-frequency`) over root bus frequency (`/proc/device-tree/clock-frequency`, which reports the 166.66 MHz FSB bus clock) (`src/ppc/cpu.rs`)
- **DOS Multi-Socket MP Table Detection**: Corrected DOS Intel MP Table topology calculation: MP Table entries represent logical processors (APIC IDs) rather than physical sockets, resolving false multi-socket reports on multi-core processors (e.g. Core 2 Quad previously reporting 4 sockets, 16 cores, 16 threads) (`src/x86/dos/mod.rs`, `src/x86/dos/mp.rs`)
- **Cross-Platform Thread Affinity**: Unified logical core affinity switching loop in ARM Linux, Windows, and BSD to use `for_each_logical_core` (`src/arm/os/mod.rs`, `src/common/os/common.rs`)
- **Android Target Build**: Resolved compile errors and missing imports when targeting `aarch64-linux-android` (`src/common/os/android.rs`)

## [2.0.0] — Add missing Intel and AMD cpu mappings, fix edge cases, and more

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustid"
version = "2.0.0"
version = "2.1.0"
edition = "2024"
authors = ["Timothy J. Warren <tim@timshome.page>"]
description = "A utility to identify the name and properties of the current cpu"
Expand Down
45 changes: 42 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BASE_RUN := cargo run
BASE_CHECK := cargo check --all-targets
endif

.PHONY: default check check-riscv check-win-arm lint fix fmt quality build build-debug build-release _cargo_cross _build-dos-tools build-dos-real _build-dos32a-tools _build-dos32a-rustid build-dos32a build-dos build-windows build-windows-arm build-windows-gnu build-arm64 build-ppc build-mac build-mac-arm build-486 build-efi-64 build-efi-32 build-efi build-486-musl clean clean-files run from-file run-x86-emu run-dos test-dos run-efi-64 run-efi-32 test coverage test-all test-arm test-x86
.PHONY: default check check-efi-64 check-efi-32 check-efi check-dos-real check-dos32a check-dos check-486 check-all check-riscv check-win-arm lint fix fmt quality build build-debug build-release _cargo_cross _build-dos-tools build-dos-real _build-dos32a-tools _build-dos32a-rustid build-dos32a build-dos build-windows build-windows-arm build-windows-gnu build-arm64 build-ppc build-mac build-mac-arm build-486 build-efi-64 build-efi-32 build-efi build-486-musl clean clean-files run from-file run-x86-emu run-dos test-dos run-efi-64 run-efi-32 test coverage test-all test-arm test-x86

# Lists the available actions
default:
Expand All @@ -40,14 +40,53 @@ endif
check:
$(BASE_CHECK)

# Compile check for 64-bit x86 EFI application
check-efi-64:
@if ! rustup target list --installed | grep -q x86_64-unknown-uefi; then rustup target add x86_64-unknown-uefi; fi
cargo check --target x86_64-unknown-uefi --features efi-build --bin efi_rustid

# Compile check for 32-bit x86 EFI application
check-efi-32:
@if ! rustup target list --installed | grep -q i686-unknown-uefi; then rustup target add i686-unknown-uefi; fi
cargo check --target i686-unknown-uefi --features efi-build --bin efi_rustid

# Compile check for both 32-bit and 64-bit EFI
check-efi: check-efi-64 check-efi-32

# Compile check for DOS (real-mode EXE)
check-dos-real: _build-dos-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-exe.x" cargo +nightly check -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos.json --release --features dos-build --bin rust86

# Compile check for DOS/32A (protected-mode LE)
check-dos32a: _build-dos32a-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-dos32a.x -C link-arg=--emit-relocs -C strip=none" cargo +nightly check -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos32a.json --features="dos32a-build" --bin dos_rustid --release

# Compile check for all DOS targets
check-dos: check-dos32a check-dos-real

# Compile check for Risc V
check-riscv:
@if ! rustup target list --installed | grep -q riscv64gc-unknown-linux-gnu; then rustup target add riscv64gc-unknown-linux-gnu; fi
cargo check --target riscv64gc-unknown-linux-gnu

# Compile check for Windows ARM
check-win-arm:
@if ! rustup target list --installed | grep -q aarch64-pc-windows-msvc; then rustup target add aarch64-pc-windows-msvc; fi
cargo check --target aarch64-pc-windows-msvc

# Compile check for Android ARM64
check-android:
@if ! rustup target list --installed | grep -q aarch64-linux-android; then rustup target add aarch64-linux-android; fi
cargo check --target aarch64-linux-android

# Compile check for 32-bit Linux 486
check-486:
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi
cargo +nightly check -Zjson-target-spec -Z build-std=std,core,alloc,panic_abort --target build-config/i486-linux.json --release

# Compile check for all supported targets and platforms
check-all: check check-efi check-dos check-riscv check-win-arm check-android check-486

# More in-depth code style checking
lint:
cargo clippy --all-targets --all-features
Expand Down Expand Up @@ -77,7 +116,7 @@ build-release:

_build-dos-tools:
# Fetch required tools (if they aren't already installed)
@if ! rustup component list --installed --toolchain nightly-x86_64-unknown-linux-gnu | grep -q rust-src; then rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu; fi
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi

# Build for DOS (EXE format)
build-dos-real: _build-dos-tools
Expand All @@ -87,7 +126,7 @@ build-dos-real: _build-dos-tools

_build-dos32a-tools:
# Fetch required tools (if they aren't already installed)
@if ! rustup component list --installed --toolchain nightly-x86_64-unknown-linux-gnu | grep -q rust-src; then rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu; fi
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi

_build-dos32a-rustid: _build-dos32a-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-dos32a.x -C link-arg=--emit-relocs -C strip=none" cargo +nightly build -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos32a.json --features="dos32a-build" --bin dos_rustid --release
Expand Down
21 changes: 16 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,24 @@ macro_rules! cfg_aliases {
fn main() {
// Setup cfg aliases
cfg_aliases! {
dos: { all(target_os = "none", target_arch= "x86", not(feature = "dos32a-build")) },
dos32a: { all(target_os = "none", target_arch= "x86", feature = "dos32a-build") },
dos_os: { all(target_os = "none", target_arch="x86") },
// Runtime / Environment Model
uefi: { target_os = "uefi" },
dos_real: { all(target_os = "none", target_arch = "x86", not(feature = "dos32a-build")) },
dos_ext: { all(target_os = "none", target_arch = "x86", feature = "dos32a-build") },
dos_os: { all(target_os = "none", target_arch = "x86") },
nostd_os: { any(target_os = "none", target_os = "uefi") },
std_os: { not(any(target_os = "none", target_os = "uefi")) },

// Operating System Families
bsd: { any(target_os = "freebsd", target_os = "openbsd", target_os = "netbsd") },
arm_cpu: { any(target_arch = "arm", target_arch="aarch64", target_arch="arm64ec") },
linux_os: { any(target_os = "android", target_os = "linux") },
unix_os: { any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd") },
windows_os: { target_os = "windows" },

// CPU Architectures
x86_cpu: { any(target_arch = "x86", target_arch = "x86_64") },
arm_cpu: { any(target_arch = "arm", target_arch = "aarch64", target_arch = "arm64ec") },
ppc_cpu: { any(target_arch = "powerpc", target_arch = "powerpc64") },
x86_cpu: { any(target_arch = "x86", target_arch = "x86_64") }
riscv_cpu: { any(target_arch = "riscv32", target_arch = "riscv64") }
}
}
34 changes: 34 additions & 0 deletions examples/xeon-e5-2470.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--------------- Rustid 2.0.0 (x86_64-linux) ---------------
System: PowerEdge R320

Architecture: x86_64-v2

Vendor: GenuineIntel (Intel)

Model: Intel(R) Xeon(R) E5-2470 v2

MicroArch: Ivy Bridge

Codename: Ivy Bridge-EP

Process Node: 22nm

Topology: 10 cores (20 threads)

Cache: L1d: 10x 32 KB, 8-way
L1i: 10x 32 KB, 8-way
L2: 10x 256 KB, 8-way
L3: 25 MB, 20-way

Frequency: 2.40 GHz

Signature: Family 6h, Model 3Eh, Stepping 4h
(0, 6, 3, 14, 4)

Features: Base: FPU TSC CX8 CX16 CMOV MMX HT APIC AMD64
SSE: SSE SSE2 SSE3 SSE4.1 SSE4.2 SSSE3
AVX: AVX
Security: NX RDRAND AES VT-x
Math: F16C
Other: x2apic POPCNT

43 changes: 41 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,53 @@ _cargo_cross:
check:
{{ base_check }}

# Compile check for 64-bit x86 EFI application
check-efi-64:
@if ! rustup target list --installed | grep -q x86_64-unknown-uefi; then rustup target add x86_64-unknown-uefi; fi
cargo check --target x86_64-unknown-uefi --features efi-build --bin efi_rustid

# Compile check for 32-bit x86 EFI application
check-efi-32:
@if ! rustup target list --installed | grep -q i686-unknown-uefi; then rustup target add i686-unknown-uefi; fi
cargo check --target i686-unknown-uefi --features efi-build --bin efi_rustid

# Compile check for both 32-bit and 64-bit EFI
check-efi: check-efi-64 check-efi-32

# Compile check for DOS (real-mode EXE)
check-dos-real: _build-dos-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-exe.x" cargo +nightly check -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos.json --release --features dos-build --bin rust86

# Compile check for DOS/32A (protected-mode LE)
check-dos32a: _build-dos32a-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-dos32a.x -C link-arg=--emit-relocs -C strip=none" cargo +nightly check -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos32a.json --features="dos32a-build" --bin dos_rustid --release

# Compile check for all DOS targets
check-dos: check-dos32a check-dos-real

# Compile check for Risc V
check-riscv:
@if ! rustup target list --installed | grep -q riscv64gc-unknown-linux-gnu; then rustup target add riscv64gc-unknown-linux-gnu; fi
cargo check --target riscv64gc-unknown-linux-gnu

# Compile check for Windows ARM
check-win-arm:
@if ! rustup target list --installed | grep -q aarch64-pc-windows-msvc; then rustup target add aarch64-pc-windows-msvc; fi
cargo check --target aarch64-pc-windows-msvc

# Compile check for Android ARM64
check-android:
@if ! rustup target list --installed | grep -q aarch64-linux-android; then rustup target add aarch64-linux-android; fi
cargo check --target aarch64-linux-android

# Compile check for 32-bit Linux 486
check-486:
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi
cargo +nightly check -Zjson-target-spec -Z build-std=std,core,alloc,panic_abort --target build-config/i486-linux.json --release

# Compile check for all supported targets and platforms
check-all: check check-efi check-dos check-riscv check-win-arm check-android check-486

# More in-depth code style checking
lint:
cargo clippy --all-targets --all-features
Expand Down Expand Up @@ -56,7 +95,7 @@ build-release:

_build-dos-tools:
# Fetch required tools (if they aren't already installed)
@if ! rustup component list --installed --toolchain nightly-x86_64-unknown-linux-gnu | grep -q rust-src; then rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu; fi
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi

# Build for DOS (EXE format)
build-dos-real: _build-dos-tools
Expand All @@ -66,7 +105,7 @@ build-dos-real: _build-dos-tools

_build-dos32a-tools:
# Fetch required tools (if they aren't already installed)
@if ! rustup component list --installed --toolchain nightly-x86_64-unknown-linux-gnu | grep -q rust-src; then rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu; fi
@if ! rustup component list --installed --toolchain nightly | grep -q rust-src; then rustup component add rust-src --toolchain nightly; fi

_build-dos32a-rustid: _build-dos32a-tools
@RUSTFLAGS="-C link-arg=-Tbuild-config/link-dos32a.x -C link-arg=--emit-relocs -C strip=none" cargo +nightly build -Zjson-target-spec -Z build-std=core,alloc,panic_abort --target build-config/i486-dos32a.json --features="dos32a-build" --bin dos_rustid --release
Expand Down
37 changes: 25 additions & 12 deletions src/arm/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,51 @@ use super::*;
use crate::common::*;
use std::collections::{BTreeMap, HashSet};

/// ARM architecture-specific data.
#[derive(Debug, Default, PartialEq)]
pub struct Cpu {
pub struct ArmData {
pub midrs: HashSet<Midr>,
pub vendor: String,
pub cpu_arch: CpuArch,
pub model: String,
pub system: Option<String>,
pub soc_model: Option<String>,
pub cores: BTreeMap<(CoreType, Midr), CpuCore>,
pub raw: BTreeMap<String, String>,
pub features: BTreeMap<&'static str, String>,
pub midr_source: DataSource,
pub features_source: DataSource,
}

pub type Cpu = crate::common::Cpu<ArmData, MicroArch>;

impl TDetect for Cpu {
fn detect() -> Self {
let info = crate::arm::os::detect();
let features = super::get_all_features();

Self {
let extra = ArmData {
midrs: info.midrs,
vendor: info.vendor,
cpu_arch: info.cpu_arch,
model: info.model,
system: OS::get_system_name(),
soc_model: OS::get_soc(),
cores: info.cores,
raw: info.raw,
features,
midr_source: info.midr_source,
features_source: info.features_source,
};

let sockets = OS::get_socket_count();
let total_cores = info.cores.iter().map(|c| c.count).sum();
let total_threads = info.cores.iter().map(|c| c.threads).sum();
let topology = Topology {
sockets,
cores: TopologyTier::new(total_cores, sockets.source),
threads: TopologyTier::new(total_threads, sockets.source),
..Default::default()
};

Self {
system: OS::get_system_name(),
vendor: info.vendor,
model: info.model,
topology,
cores: info.cores,
features,
extra,
}
}
}
Expand Down
Loading