cpuinfo_resource Traceback when governors file does not exist

Bug #1866037 reported by Jeff Lane 
6
This bug affects 1 person
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/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
speed: -2
type: aarch64
Traceback (most recent call last):
  File "./cpuinfo_resource", line 61, in <module>
    sys.exit(main())
  File "./cpuinfo_resource", line 55, in main
    parser.run(result)
  File "/usr/lib/python3/dist-packages/checkbox_support/parsers/cpuinfo.py", line 202, in run
    result.setProcessor(processor)
  File "./cpuinfo_resource", line 47, in setProcessor
    print("governors: %s" % open(GOVERNORS_FILENAME).read().strip())
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors'

Revision history for this message
Jeff Lane  (bladernr) wrote :

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

description: updated
Changed in plainbox-provider-resource:
status: In Progress → Fix Committed
Changed in plainbox-provider-resource:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.