cpuinfo_resource Traceback when governors file does not exist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox Provider - Resource |
Fix Released
|
High
|
Jeff Lane |
Bug Description
The cpuinfo_resource script looks for a frequency governors file. This file does not exist on all CPUs or architectures and the script exits with an error code and dumps a traceback when it tries opening the file.
Needs some error handling added.
This is from an ARM server where the governors file does not exist. The error is the same for any system without the cpufreq folder in sysfs.
ubuntu@d05-4:~$ ./cpuinfo_resource
bogomips: 100
cache: -1
count: 64
model: aarch64
model_number: 0x0
model_revision: 2
model_version: 8
other: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
platform: aarch64
checking governor at /sys/devices/
speed: -2
type: aarch64
Traceback (most recent call last):
File "./cpuinfo_
sys.
File "./cpuinfo_
parser.
File "/usr/lib/
result.
File "./cpuinfo_
print(
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/
Related branches
- Rod Smith: Approve
-
Diff: 16 lines (+4/-1)1 file modifiedbin/cpuinfo_resource (+4/-1)
Changed in plainbox-provider-resource: | |
status: | In Progress → Fix Committed |
Changed in plainbox-provider-resource: | |
status: | Fix Committed → Fix Released |
And now the corrected output. This was on my laptop in a VM which also fails for the same reason) but the error and output are identical for both the failing and fixed cases:
bladernr@ arcadiaVM: ~/development/ plainbox- provider- resource/ bin$ ./cpuinfo_resource
bogomips: 5423
cache: 8388608
count: 3
model: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
model_number: 6
model_revision: 10
model_version: 142
other: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb invpcid_single pti ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts hwp hwp_act_window hwp_epp
platform: x86_64
speed: 2711
type: GenuineIntel
governors: GOVERNORS NOT FOUND