ohai icon indicating copy to clipboard operation
ohai copied to clipboard

Fall back to /proc/cpuinfo if lscpu doesn't have CPU totals

Open stanhu opened this issue 3 years ago • 1 comments

Description

https://github.com/chef/ohai/pull/1454 made lscpu the primary way Ohai gathers CPU data, but the parser doesn't handle the output from a Raspberry Pi 4 Cortex-A72. For example, an ARM cluster has the output Core(s) per cluster instead of Core(s) per socket.

We should fall back to /proc/cpuinfo if we don't get reasonable data back. It's not enough just to have lscpu output.

Related Issue

  • https://github.com/chef/ohai/issues/1760
  • https://github.com/chef/ohai/issues/1755

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • [x] I have read the CONTRIBUTING document.
  • [x] I have run the pre-merge tests locally and they pass.
  • [x] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.
  • [ ] All commits have been signed-off for the Developer Certificate of Origin.

stanhu avatar Jul 27 '22 06:07 stanhu

Ping @stanhu

jaymzh avatar Aug 23 '22 19:08 jaymzh

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 24 '22 16:08 sonarqubecloud[bot]

@jaymzh Done, thanks.

stanhu avatar Aug 24 '22 16:08 stanhu