LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2012, 08:13 PM   #1
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Seeing CPU freq as adjusted by governor (from command line)


Hi. My Linux kernel is currently set to use the ONDEMAND cpu freq governor by default. However, I am wondering: how can I see what my actual cpu freq is at any given moment? I'd like to be able to see (and maybe record) how the governor is responding when I run or don't run certain applications, preferably from the command line.

/proc/cpuinfo always displays the same cpu MHZ value, so either that is not the actual speed, or the governor is not working. I don't use a DE, so don't bother asking which DE I use.
 
Old 03-05-2012, 08:27 PM   #2
corbintechboy
Member
 
Registered: Sep 2003
Location: Kentucky
Posts: 480
Blog Entries: 1

Rep: Reputation: 51
cat /proc/cpuinfo

if it is not showing them cpufreq is not working. That shows the stat of the CPU as reported by the kernel, so it is dead on target whether working or not.

Last edited by corbintechboy; 03-05-2012 at 08:28 PM.
 
Old 03-05-2012, 11:42 PM   #3
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467

Original Poster
Blog Entries: 60

Rep: Reputation: 51
Quote:
Originally Posted by corbintechboy View Post
cat /proc/cpuinfo

if it is not showing them cpufreq is not working. That shows the stat of the CPU as reported by the kernel, so it is dead on target whether working or not.
Okay, so I guess it isn't working, because all three CPUs show

Code:
cpu MHz		: 3314.309
regardless of when I check. So then, the question is: why isn't it working?

I see these messages with dmesg, whatever they mean:

Code:
$ dmesg | grep gov
[    1.201680] cpuidle: using governor ladder
[    1.201799] cpuidle: using governor menu
 
Old 03-06-2012, 12:05 PM   #4
corbintechboy
Member
 
Registered: Sep 2003
Location: Kentucky
Posts: 480
Blog Entries: 1

Rep: Reputation: 51
I would try manually loading the kernel driver for your CPU and see if there are any errors. Then I would start cpufreq from the command line with the driver loaded and see if there are any errors.

Or you could look through dmesg and see if there are any errors. Are you starting cpufreq as a daemon? On Arch (or Chakra) I load the daemon in /etc/rc.conf and load the module under the modules section. Then I went to /etc/conf.d/cpufreq.conf (going off memory here) and set up the config file for on demand.

Other then those ideas I have none. I have not used Gentoo in ages and don't know the routine for it as well.
 
1 members found this post helpful.
Old 03-06-2012, 10:07 PM   #5
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467

Original Poster
Blog Entries: 60

Rep: Reputation: 51
I tried using cpufreq-info, which tells me:

Code:
# cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 2:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
Code:
I tried to start cpufreq:

 # /etc/init.d/cpufreqd start
 * cpufreqd requires the kernel to be configured with CONFIG_CPU_FREQ
 * Make sure that the appropiate kernel drivers for your CPU are
 * built-in or loaded.
 * ERROR: cpufreqd failed to start
I knew I had enabled this, but just to be certain I rebuilt the kernel, making sure that this is enabled. But the cpufreq tools still give the same error message. I looked through dmesg output, but I couldn't find any error messages that were informative.

I use a static kernel, version 3.2.9 (x86_64). I have the on demand governor, performance governor, and user space governors built, with default set to on-demand.
 
Old 03-07-2012, 09:55 AM   #6
corbintechboy
Member
 
Registered: Sep 2003
Location: Kentucky
Posts: 480
Blog Entries: 1

Rep: Reputation: 51
What CPU are you using?
 
Old 03-08-2012, 01:25 AM   #7
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467

Original Poster
Blog Entries: 60

Rep: Reputation: 51
Code:
$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 5
model name	: AMD Athlon(tm) II X3 455 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 3314.666
cache size	: 512 KB
physical id	: 0
siblings	: 3
core id		: 0
cpu cores	: 3
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips	: 6629.33
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 5
model name	: AMD Athlon(tm) II X3 455 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 3314.666
cache size	: 512 KB
physical id	: 0
siblings	: 3
core id		: 1
cpu cores	: 3
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips	: 6629.51
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 5
model name	: AMD Athlon(tm) II X3 455 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 3314.666
cache size	: 512 KB
physical id	: 0
siblings	: 3
core id		: 2
cpu cores	: 3
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips	: 6629.51
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
 
Old 03-08-2012, 08:05 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You also need the powernow-k8 module to get it working.
 
Old 03-08-2012, 12:40 PM   #9
corbintechboy
Member
 
Registered: Sep 2003
Location: Kentucky
Posts: 480
Blog Entries: 1

Rep: Reputation: 51
Quote:
Originally Posted by TobiSGD View Post
You also need the powernow-k8 module to get it working.
Thats exactly what I was getting at .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU freq in Ubuntu 9.04 Pazau Linux - Software 7 04-29-2009 09:40 AM
CPU freq driver mrrao Linux - Hardware 1 02-14-2008 11:43 PM
cpu speed governor and wireless queries kanwar_rajan Linux - Laptop and Netbook 3 02-28-2007 09:51 PM
how to control cpu freq ruh31 Debian 6 02-14-2005 09:58 AM
Lower CPU freq Adony Linux - Hardware 2 10-01-2004 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration