Shows wrong cpu frequency on ARM

Bug #675442 reported by Marcin Juszkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: byobu

On my PandaBoard (dual core ARM) Byobu shows "2x2.0GHz" as speed.

But CPU is clocked at 1GHz and on ARM there is no entry in /proc/cpuinfo which shows that:

10:16 hrw@panda:~$ cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
processor : 0
BogoMIPS : 2013.49

processor : 1
BogoMIPS : 1963.08

Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part : 0xc09
CPU revision : 2

Hardware : OMAP4430 Panda Board
Revision : 0020
Serial : 0000000000000000

Tags: armel

Related branches

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi there,

Thanks for the bug report and /proc/cpuinfo.

So the script tries to use BogoMIPS when there is no specific clock speed specified. Looks like I need to divide that by the number of processors?

Any chance you can collect a couple of /proc/cpuinfo's and attach them to this bug so that I can confirm this hypothesis?

Thanks!

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Also, what is the value of /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ?

Changed in byobu (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

On my single core ARM devices 1MHz == 1 bogomips:

hrw@efika:~/devel/ubuntu$ cat /proc/cpuinfo
Processor : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 799.53
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc08
CPU revision : 5

Hardware : Genesi Efika MX (Smartbook)
Revision : 51030
Serial : 0000000000000000

On another it is similar:

-bash-2.05b$ cat /proc/cpuinfo
Processor : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 249.96
Features : swp half fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part : 0xc08
CPU revision : 3

Hardware : Nokia RX-51 board
Revision : 2101
Serial : 0000000000000000

And pandaboard lacks cpufreq driver now.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Okay, cool, thanks.

So basically, if cpu_freq uses "bogomips" to estimate the frequency, I need to divide by the total number of cores present on the system. Thanks, I'll get this fixed.

Changed in byobu (Ubuntu):
status: Incomplete → Triaged
Changed in byobu (Ubuntu):
status: Triaged → In Progress
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 3.10-0ubuntu1

---------------
byobu (3.10-0ubuntu1) natty; urgency=low

  * usr/lib/byobu/custom: fix typo in for loop, LP: #673728, thanks for
    the triage Jorge E. Gómez
  * usr/bin/byobu-janitor: make sure this runs to completion, LP: #676605
  * usr/lib/byobu/cpu_freq: scale bogomips by number of processors, if
    using bogomips to estimate frequency, LP: #675442
  * etc/byobu/statusrc, usr/bin/byobu-config, usr/lib/byobu/Makefile.am,
    usr/lib/byobu/swap, usr/share/byobu/profiles/common,
    usr/share/man/man1/byobu.1: add a swap memory usage notification,
    LP: #677259
  * usr/lib/byobu/release: fix the ubuntu devel release printing
 -- Dustin Kirkland <email address hidden> Fri, 12 Nov 2010 22:45:25 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

I updated to newer byobu package. Now I have "2xGHz" in status bar - see attached screenshot.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm flying kind of blind here, as I don't have any arm hardware ...

What is the output of:

sh -x /usr/lib/byobu/cpu_freq

Changed in byobu (Ubuntu):
status: Fix Released → In Progress
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 3.11-0ubuntu1

---------------
byobu (3.11-0ubuntu1) natty; urgency=low

  [ Marcin Juszkiewicz ]
  * usr/lib/byobu/cpu_freq: fix cpu frequency detection on ARM, LP: #675442

  [ Dustin Kirkland ]
  * etc/update-motd.d/55-window-manager: fix a spelling error, allow for
    easy disabling of the motd message
  * usr/share/byobu/keybindings/f-keys: resize on each window change,
    LP: #680559
  * README: minor edit to the instructions; tested and working for me now
 -- Dustin Kirkland <email address hidden> Wed, 24 Nov 2010 12:59:37 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

hrw@panda:~$ sh -x /usr/lib/byobu/cpu_freq
+ PKG=byobu
+ color
+ [ = --detail ]
+ [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ]
+ egrep -i -m 1 ^cpu MHz|^clock /proc/cpuinfo
+ awk -F[:.] { printf "%.1f", $2 / 1000 }
+ freq=
+ true
+ color b c W
+ true
+ color -
+ true
+ color c W
+ true
+ color -
+ true
+ printf %s%s GHz
GHz hrw@panda:~$

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

And same command after upgrade:

hrw@panda:~$ sh -x /usr/lib/byobu/cpu_freq
+ PKG=byobu
+ color
+ [ = --detail ]
+ [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ]
+ egrep -q -s -i -m 1 ^cpu MHz|^clock /proc/cpuinfo
+ getconf _NPROCESSORS_ONLN
+ count=2
+ egrep -i -m 1 ^bogomips /proc/cpuinfo
+ awk -F[:.] { print $2 }
+ freq= 2009
+ echo 2009 2
+ awk {printf "%.1f\n", $1/$2/1000}
+ freq=1.0
+ color b c W
+ true
+ color -
+ true
+ color c W
+ true
+ color -
+ true
+ printf %s%s 1.0 GHz
1.0GHz hrw@panda:~$

So thanks for fixing.

Revision history for this message
Tony Crawford (tonybcrawford) wrote :

I'm not sure that this was the correct fix:

I'm running Ubuntu 11.04 on an quad core i5 system. The system monitor shows each CPU is running at 2.30 GHz but BYOBU shows 4x0.8GHz. I think the fix that was made may have a couple of problems:

1) The processors are noted as 0, 1, 2 & 3 and it appears that the actual CPU speed was divided by 3 instead of 4
     -> 2.30 / 3 = 0.76666666 (which is rounded to 0.8)

2) However, I think the idea of dividing by the number of processors may not be correct... at least not for my configuration.

I hope this is helpful.

Cheers

Revision history for this message
Tony Crawford (tonybcrawford) wrote :

By the way, my version is BYOBU 3.33

Revision history for this message
Tony Crawford (tonybcrawford) wrote :
Download full text (4.1 KiB)

FYI, a copy of my /proc/cpuinfo file is shown below. I noticed that the first three processors show a cpu speed of 800 MHz but the final cpu shows a speed of 2301 MHz.

tony@system76:/proc$ cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
stepping : 7
cpu MHz : 800.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4590.10
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
stepping : 7
cpu MHz : 800.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4589.58
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
stepping : 7
cpu MHz : 800.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4589.57
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

process...

Read more...

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 675442] Re: Shows wrong cpu frequency on ARM

Hi Tony,

Would you please open a new bug with this information, please, and
I'll take a look at it?

Thanks!
:-Dustin

Revision history for this message
Tony Crawford (tonybcrawford) wrote :

Will do, thanks Dustin :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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