Skip to main content

parse_cpuinfo

Function parse_cpuinfo 

Source
pub fn parse_cpuinfo(contents: &str) -> (Option<String>, Option<String>)
Expand description

Parse (vendor, model) out of /proc/cpuinfo contents.

GH-2395: detect_cpu hardcoded vendor: "Unknown", model: "Unknown", so the roofline block of apr profile reported Hardware: Unknown Unknown (24 cores, …) while the peak GFLOPS and bandwidth printed beside it — the basis for the MEMORY BOUND verdict — claimed to describe that machine.

Split out from the filesystem read so it is testable without /proc. Handles the x86 layout (vendor_id / model name) and the aarch64 layout (CPU implementer / Model, with no model name on many kernels).