LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-27-2012, 02:39 AM   #1
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Rep: Reputation: Disabled
CPU frequency


Hello everyone. I am trying to figure out how to get current cpu/core frequency. I know that i can use system monitor for that, but i want non-gui program. And i know that in /proc/cpuinfo stored NOT the current CPU frequency. And i need to now my CPU max frequency also. Can anyone help me with that??
P.S. I lately i have found out that not all my computers have /sys/devices/system/cpu*/cpufreq, so looking there is not an option.

Thanks in advance. Ed.
 
Old 01-27-2012, 02:51 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Have you tried conky? It also can show cpu usage and many other things.

Regards
 
Old 01-27-2012, 03:34 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Edward18 View Post
i know that in /proc/cpuinfo stored NOT the current CPU frequency.
Seems to be on my system (2.6.38.7 kernel). Here's a excerpt from /proc/cpuinfo:
Code:
model name	: Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
stepping	: 7
cpu MHz		: 1600.000
 
Old 01-27-2012, 03:57 AM   #4
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
lshw (cut down to the CPU bit)-

Quote:
*-cpu
description: CPU
product: AMD Phenom(tm) II X2 550 Processor
vendor: Hynix Semiconductor (Hyundai Electronics)
physical id: 4
bus info: cpu@0
version: AMD Phenom(tm) II X2 550 Processor
slot: Socket M2
size: 800MHz
capacity: 3200MHz
width: 64 bits
clock: 200MHz
capabilities: fpu fpu_exception wp 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 x86-64 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 cpufreq
Its not prefect (it gives me 3200MHz as max sped, really its 3100MHz).

'Size' is the current speed (800MHz in this case)

Quote:
Originally Posted by catkin View Post
Seems to be on my system (2.6.38.7 kernel). Here's a excerpt from /proc/cpuinfo:
Code:
model name	: Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
stepping	: 7
cpu MHz		: 1600.000
Same here-

Quote:
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 4
model name : AMD Phenom(tm) II X2 550 Processor
stepping : 3
microcode : 0x10000af
cpu MHz : 800.000
Doesnt seem to give the max speed though.
 
Old 01-27-2012, 06:57 AM   #5
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by ukiuki View Post
Have you tried conky? It also can show cpu usage and many other things.

Regards
Yeah conky is good thing, but unfortunately i can't use it in my case. I need something that i can detect cpu freq of remote computer. I know its kinda difficulte but thats what i want.
 
Old 01-27-2012, 07:02 AM   #6
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by catkin View Post
Seems to be on my system (2.6.38.7 kernel). Here's a excerpt from /proc/cpuinfo:
Code:
model name	: Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
stepping	: 7
cpu MHz		: 1600.000
Yeah right. In model name it says 3.10 GHz, i guess its your max CPU speed right???
 
Old 01-27-2012, 07:02 AM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
cpufrequtils
http://www.thinkwiki.org/wiki/How_to_use_cpufrequtils

should be available for most distros
 
Old 01-27-2012, 11:53 AM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by Edward18 View Post
... I know that i can use system monitor for that, but i want non-gui program...
and

Quote:
I need something that i can detect cpu freq of remote computer.
If
  • by system monitor you mean the kde system monitor (also known as kde system guard)
and
  • by remote system you mean a computer that is connected to a LAN and there is data transmission between the LAN and the monitoring computer (ie, not blocked by, eg, a firewall or one of the computers having no network connectivity)

That does not necessarily exclude kde system guard. You can run in a client/server kind of mode, where one computer just runs the display part, and the other computer runs the relatively small monitoring part. Whether this really is a sensible solution for your problem, or better than whatever else you might come up with, I really don't know, but I just wanted to mention that it might still be a possibility.

Anyway, cpufreq-info should do what you want. -f gives you just the frequency, rather than giving you several lines, which include the frequency on one of them, and c allows you to specify a core; you may have to specify, eg, core 0 and core 1 alternately, because I can't see a way of specifying *, or something, for 'give me all the cores that you've got'. (Maybe, that's only 1, which would render that point moot.) This will give you a file, and then you'll have to do something with it.

I thought that maybe collectl would do it, because that can be fairly neat, but I can't see from the man page any reference to current cpu clock.
 
Old 01-28-2012, 01:43 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Edward18 View Post
Yeah right. In model name it says 3.10 GHz, i guess its your max CPU speed right???
Yes -- I included in the excerpt to show that "cpu MHz" is the current frequency.
 
Old 01-29-2012, 04:07 AM   #10
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by salasi View Post
and



If
  • by system monitor you mean the kde system monitor (also known as kde system guard)
and
  • by remote system you mean a computer that is connected to a LAN and there is data transmission between the LAN and the monitoring computer (ie, not blocked by, eg, a firewall or one of the computers having no network connectivity)

That does not necessarily exclude kde system guard. You can run in a client/server kind of mode, where one computer just runs the display part, and the other computer runs the relatively small monitoring part. Whether this really is a sensible solution for your problem, or better than whatever else you might come up with, I really don't know, but I just wanted to mention that it might still be a possibility.

Anyway, cpufreq-info should do what you want. -f gives you just the frequency, rather than giving you several lines, which include the frequency on one of them, and c allows you to specify a core; you may have to specify, eg, core 0 and core 1 alternately, because I can't see a way of specifying *, or something, for 'give me all the cores that you've got'. (Maybe, that's only 1, which would render that point moot.) This will give you a file, and then you'll have to do something with it.

I thought that maybe collectl would do it, because that can be fairly neat, but I can't see from the man page any reference to current cpu clock.
Thanks, i will try this.
 
Old 01-30-2012, 01:53 AM   #11
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by salasi View Post
and



If
  • by system monitor you mean the kde system monitor (also known as kde system guard)
and
  • by remote system you mean a computer that is connected to a LAN and there is data transmission between the LAN and the monitoring computer (ie, not blocked by, eg, a firewall or one of the computers having no network connectivity)

That does not necessarily exclude kde system guard. You can run in a client/server kind of mode, where one computer just runs the display part, and the other computer runs the relatively small monitoring part. Whether this really is a sensible solution for your problem, or better than whatever else you might come up with, I really don't know, but I just wanted to mention that it might still be a possibility.

Anyway, cpufreq-info should do what you want. -f gives you just the frequency, rather than giving you several lines, which include the frequency on one of them, and c allows you to specify a core; you may have to specify, eg, core 0 and core 1 alternately, because I can't see a way of specifying *, or something, for 'give me all the cores that you've got'. (Maybe, that's only 1, which would render that point moot.) This will give you a file, and then you'll have to do something with it.

I thought that maybe collectl would do it, because that can be fairly neat, but I can't see from the man page any reference to current cpu clock.
I've tried cpufreq but it says that no or unkown cpufreq driver is active on this CPU. What am i gonna do now, do i need to install proper drivers for my CPU, or i must configure them somehow?
 
Old 01-31-2012, 01:57 AM   #12
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by catkin View Post
Yes -- I included in the excerpt to show that "cpu MHz" is the current frequency.
OK if "cpu MHz" is the current frequency, so how i can get max speed??????
 
Old 01-31-2012, 02:35 AM   #13
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
SOLVED !!!!! Now i can find my max and current speed. If anyone is interested: sudo dmidecode -t 4 | grep Max\ Speed this for max cpu speed and for current: sudo dmidecode -t 4 | grep Current\ Speed.
 
Old 01-31-2012, 11:50 AM   #14
markseger
Member
 
Registered: Jul 2003
Posts: 244

Rep: Reputation: 26
collectl know all!

collectl --import misc
waiting for 1 second sample...
#<------Misc------>
# UTim MHz MT Log
2 2394 0 3

you can even combine with other things:

collectl --import misc -scn
waiting for 1 second sample...
#<--------CPU--------><----------Network----------><------Misc------>
#cpu sys inter ctxsw KBIn PktIn KBOut PktOut UTim MHz MT Log
0 0 26 46 0 1 0 1 2 2394 0 3
2 2 25 31 0 1 0 1 2 2394 0 3


-mark
 
Old 02-01-2012, 06:35 AM   #15
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by markseger View Post
collectl know all!

collectl --import misc
waiting for 1 second sample...
#<------Misc------>
# UTim MHz MT Log
2 2394 0 3

you can even combine with other things:

collectl --import misc -scn
waiting for 1 second sample...
#<--------CPU--------><----------Network----------><------Misc------>
#cpu sys inter ctxsw KBIn PktIn KBOut PktOut UTim MHz MT Log
0 0 26 46 0 1 0 1 2 2394 0 3
2 2 25 31 0 1 0 1 2 2394 0 3


-mark

Nice Thanks Mark.
 
  


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 frequency scaling with Pentium(R) Dual-Core CPU E5200 @ 2.50GHz tramni1980 Slackware 5 08-16-2009 08:29 AM
CPU clock frequency sabyasachi_serc Linux - Kernel 1 02-06-2009 01:17 AM
Cpu frequency question mrrao Linux - Newbie 1 02-01-2008 03:00 PM
CPU frequency scaling PatrickMay16 General 10 07-10-2007 08:07 PM
wrong cpu frequency dresnu Mandriva 12 03-08-2005 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:45 PM.

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