byobu should revert to dmidecode if bogomips in /proc/cpuinfo are set to zero
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
A number of cloud server offerings -- e.g., those from Oracle (OCI), Hetzner, Netcup -- based on current Ampere® Altra® processors report zero bogomips on Linux, which results in a reported cpu frequency of "0.0 GHz".
However, it's possible to revert to dmidecode which actually reports the correct current/base clock speed (in MHz).
The below patch should apply for all/all recent versions of byobu:
--- byobu-6.
+++ byobu-6.
@@ -37,6 +37,11 @@ __cpu_freq() {
+ if [ $freq = "0.0" ]; then
+ hz=$(dmidecode | egrep -m 1 -i "current speed:" | sed -e 's|.*: ||' -e 's| .*||')
+ fpdiv $hz "1000" 1 # 1Ghz
+ freq="$_RET"
+ fi
fi
elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then
tags: | added: needs-upstream-report |
The attachment "revert to dmidecode if bogomips in /proc/cpuinfo are set to zero" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]