2020-03-04 10:39:29 |
Jeff Lane |
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. |
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' |
|