Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78103 - basc: gathered cpu speed is wrong
Summary: basc: gathered cpu speed is wrong
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Pieter Van den Abeele (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-15 09:32 UTC by Toralf Förster
Modified: 2007-02-11 09:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2005-01-15 09:32:17 UTC
I use speedstepping (kernel governor ondemand). So basc gathered
CPU_FREQ=599
instead of the max. speed of 1.7 GHz of the processor max speed.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Alexander Mieland 2005-01-15 11:44:39 UTC
it would be very helpfull if you can tell us which cpu (vendor and model) you have, what `cat /proc/cpuinfo` says and if there is a file `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
Comment 2 Alexander Mieland 2005-01-15 11:46:39 UTC
... or whatever could help us in finding the correct cpu-frequency...
Comment 3 Toralf Förster gentoo-dev 2005-01-15 14:16:10 UTC
ok, here is the nhh221 ~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.70GHz
stepping        : 6
cpu MHz         : 1698.673
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe est tm2
bogomips        : 3366.91

/proc/cpuinfo:

and here are tha actual values:
nhh221 ~ # tail /sys/devices/system/cpu/cpu0/cpufreq/*
==> /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus <==
0

==> /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq <==
1700000

==> /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq <==
1700000

==> /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq <==
600000

==> /sys/devices/system/cpu/cpu0/cpufreq/ondemand <==
tail: error reading `/sys/devices/system/cpu/cpu0/cpufreq/ondemand': Is a directory

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies <==
1700000 1700000 1700000 1400000 1200000 1000000 800000 600000

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors <==
powersave performance ondemand userspace

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq <==
1700000

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver <==
centrino

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <==
ondemand

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq <==
1700000

==> /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq <==
600000

Comment 4 Alexander Mieland 2005-01-15 16:14:59 UTC
okay great.
This will be fixed in 1.5.7, thanks.
Comment 5 Alexander Mieland 2005-01-16 15:24:13 UTC
Fixed in 1.5.7
Comment 6 Pieter Van den Abeele (RETIRED) gentoo-dev 2005-01-18 07:17:17 UTC
incvs
Comment 7 Bas van Dijk 2005-01-18 14:17:09 UTC
There's a little bug near line 786:

CPU_FREQ = commands.getoutput("cat sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 2>/dev/null")
CPU_FREQ = CPU_FREQ/1000

which causes this error:

>  Getting CPU frequency...
Traceback (most recent call last):
  File "/usr/bin/basc", line 787, in ?
    CPU_FREQ = CPU_FREQ/1000
TypeError: unsupported operand type(s) for /: 'str' and 'int'

So we just need to cast the string to an int:

CPU_FREQ = int(commands.getoutput("cat sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 2>/dev/null"))
CPU_FREQ = CPU_FREQ/1000