Skip to content

Commit

Permalink
Merge pull request #387 from zeeke/us/arm-vendor
Browse files Browse the repository at this point in the history
Populate `Vendor` field for ARM cpus
  • Loading branch information
jaypipes authored Oct 24, 2024
2 parents e050c5a + 37a20d2 commit c1bfc6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cpu/cpu_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,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
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/cpu/cpu_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func TestArmCPU(t *testing.T) {
}

for _, p := range info.Processors {
if p.Vendor == "" {
t.Fatalf("Expected not empty vendor field.")
}
if p.TotalCores == 0 {
t.Fatalf("Expected >0 cores but got 0.")
}
Expand Down

0 comments on commit c1bfc6e

Please sign in to comment.