All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting cpu frequency
@ 2006-02-11 20:47 Nico Golde
  2006-02-11 21:37 ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Golde @ 2006-02-11 20:47 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

Hi,
at the moment I try to get the current cpu frequency via 
using the cpufreq_get() function defined in linux/cpufreq.h.
Can someone point me to the headers I have to include to let 
this work because just doing #include <linux/cpufreq.h> 
results in a bunch of errors:
[...] 
In file included from /usr/include/linux/cpu.h:22,
                 from cpu.c:2:
/usr/include/linux/sysdev.h:31: error: field 'drivers' has incomplete type
/usr/include/linux/sysdev.h:35: error: syntax error before 'pm_message_t'
/usr/include/linux/sysdev.h:37: error: field 'kset' has incomplete type
/usr/include/linux/sysdev.h:50: error: field 'entry' has incomplete type
/usr/include/linux/sysdev.h:54: error: syntax error before 'pm_message_t'
/usr/include/linux/sysdev.h:69: error: syntax error before 'u32'
/usr/include/linux/sysdev.h:72: error: syntax error before '}' token
/usr/include/linux/sysdev.h:79: error: field 'attr' has incomplete type
/usr/include/linux/sysdev.h:80: error: syntax error before 'ssize_
[...] 
Using 2.6.14.
Regards Nico
P.S. Please CC me, I am not subsribed, thanks

-- 
Nico Golde - JAB: nion@jabber.ccc.de | GPG: 0x73647CFF
http://www.ngolde.de | http://www.muttng.org | http://grml.org
Forget about that mouse with 3/4/5 buttons -
gimme a keyboard with 103/104/105 keys!

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting cpu frequency
  2006-02-11 20:47 Getting cpu frequency Nico Golde
@ 2006-02-11 21:37 ` Dave Jones
  2006-02-11 21:42   ` Nico Golde
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2006-02-11 21:37 UTC (permalink / raw)
  To: Nico Golde; +Cc: linux-kernel

On Sat, Feb 11, 2006 at 09:47:34PM +0100, Nico Golde wrote:
 > Hi,
 > at the moment I try to get the current cpu frequency via 
 > using the cpufreq_get() function defined in linux/cpufreq.h.
 > Can someone point me to the headers I have to include to let 
 > this work because just doing #include <linux/cpufreq.h> 
 > results in a bunch of errors:
 > [...] 
 > In file included from /usr/include/linux/cpu.h:22,
 >                  from cpu.c:2:
 > /usr/include/linux/sysdev.h:31: error: field 'drivers' has incomplete type
 > /usr/include/linux/sysdev.h:35: error: syntax error before 'pm_message_t'
 > /usr/include/linux/sysdev.h:37: error: field 'kset' has incomplete type
 > /usr/include/linux/sysdev.h:50: error: field 'entry' has incomplete type
 > /usr/include/linux/sysdev.h:54: error: syntax error before 'pm_message_t'
 > /usr/include/linux/sysdev.h:69: error: syntax error before 'u32'
 > /usr/include/linux/sysdev.h:72: error: syntax error before '}' token
 > /usr/include/linux/sysdev.h:79: error: field 'attr' has incomplete type
 > /usr/include/linux/sysdev.h:80: error: syntax error before 'ssize_
 > [...] 
 > Using 2.6.14.
 > Regards Nico
 > P.S. Please CC me, I am not subsribed, thanks

Are you trying to do this from a userspace program ?
If so, this isn't going to work.

		Dave



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting cpu frequency
  2006-02-11 21:37 ` Dave Jones
@ 2006-02-11 21:42   ` Nico Golde
  2006-02-11 22:13     ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Golde @ 2006-02-11 21:42 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

Hallo Dave,

* Dave Jones <davej@redhat.com> [2006-02-11 22:38]:
> On Sat, Feb 11, 2006 at 09:47:34PM +0100, Nico Golde wrote:
>  > Hi,
>  > at the moment I try to get the current cpu frequency via 
>  > using the cpufreq_get() function defined in linux/cpufreq.h.
>  > Can someone point me to the headers I have to include to let 
>  > this work because just doing #include <linux/cpufreq.h> 
>  > results in a bunch of errors:
>  > [...] 
>  > In file included from /usr/include/linux/cpu.h:22,
>  >                  from cpu.c:2:
>  > /usr/include/linux/sysdev.h:31: error: field 'drivers' has incomplete type
>  > /usr/include/linux/sysdev.h:35: error: syntax error before 'pm_message_t'
>  > /usr/include/linux/sysdev.h:37: error: field 'kset' has incomplete type
>  > /usr/include/linux/sysdev.h:50: error: field 'entry' has incomplete type
>  > /usr/include/linux/sysdev.h:54: error: syntax error before 'pm_message_t'
>  > /usr/include/linux/sysdev.h:69: error: syntax error before 'u32'
>  > /usr/include/linux/sysdev.h:72: error: syntax error before '}' token
>  > /usr/include/linux/sysdev.h:79: error: field 'attr' has incomplete type
>  > /usr/include/linux/sysdev.h:80: error: syntax error before 'ssize_
>  > [...] 
>  > Using 2.6.14.
>  > Regards Nico
>  > P.S. Please CC me, I am not subsribed, thanks
> 
> Are you trying to do this from a userspace program ?
> If so, this isn't going to work.

Yes I am.
Regards Nico
-- 
Nico Golde - JAB: nion@jabber.ccc.de | GPG: 0x73647CFF
http://www.ngolde.de | http://www.muttng.org | http://grml.org
Forget about that mouse with 3/4/5 buttons -
gimme a keyboard with 103/104/105 keys!

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting cpu frequency
  2006-02-11 21:42   ` Nico Golde
@ 2006-02-11 22:13     ` Dave Jones
  2006-02-11 22:16       ` Nico Golde
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2006-02-11 22:13 UTC (permalink / raw)
  To: Nico Golde; +Cc: linux-kernel

On Sat, Feb 11, 2006 at 10:42:07PM +0100, Nico Golde wrote:
 > Hallo Dave,
 > 
 > * Dave Jones <davej@redhat.com> [2006-02-11 22:38]:
 > > On Sat, Feb 11, 2006 at 09:47:34PM +0100, Nico Golde wrote:
 > >  > Hi,
 > >  > at the moment I try to get the current cpu frequency
 > >  > P.S. Please CC me, I am not subsribed, thanks
 > > 
 > > Are you trying to do this from a userspace program ?
 > > If so, this isn't going to work.
 > 
 > Yes I am.

Read it from sysfs or /proc/cpuinfo.
But, why does your app care ?
If it's to set up some sort of timing loop, it's going to
fail miserably.

		Dave
		

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting cpu frequency
  2006-02-11 22:13     ` Dave Jones
@ 2006-02-11 22:16       ` Nico Golde
  2006-02-12  8:46         ` Mattia Dongili
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Golde @ 2006-02-11 22:16 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

* Dave Jones <davej@redhat.com> [2006-02-11 23:15]:
> On Sat, Feb 11, 2006 at 10:42:07PM +0100, Nico Golde wrote:
>  > Hallo Dave,
>  > 
>  > * Dave Jones <davej@redhat.com> [2006-02-11 22:38]:
>  > > On Sat, Feb 11, 2006 at 09:47:34PM +0100, Nico Golde wrote:
>  > >  > Hi,
>  > >  > at the moment I try to get the current cpu frequency
>  > >  > P.S. Please CC me, I am not subsribed, thanks
>  > > 
>  > > Are you trying to do this from a userspace program ?
>  > > If so, this isn't going to work.
>  > 
>  > Yes I am.
> 
> Read it from sysfs or /proc/cpuinfo.

Thats exactly what I dont wanted to do and thought its 
possible without reading a file. So it seems to be not, 
thank you will use sysfs to get the information.
Regards Nico

-- 
Nico Golde - JAB: nion@jabber.ccc.de | GPG: 0x73647CFF
http://www.ngolde.de | http://www.muttng.org | http://grml.org
Forget about that mouse with 3/4/5 buttons -
gimme a keyboard with 103/104/105 keys!

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting cpu frequency
  2006-02-11 22:16       ` Nico Golde
@ 2006-02-12  8:46         ` Mattia Dongili
  0 siblings, 0 replies; 6+ messages in thread
From: Mattia Dongili @ 2006-02-12  8:46 UTC (permalink / raw)
  To: Nico Golde; +Cc: linux-kernel

On Sat, Feb 11, 2006 at 11:16:48PM +0100, Nico Golde wrote:
> * Dave Jones <davej@redhat.com> [2006-02-11 23:15]:
> > On Sat, Feb 11, 2006 at 10:42:07PM +0100, Nico Golde wrote:
> >  > Hallo Dave,
> >  > 
> >  > * Dave Jones <davej@redhat.com> [2006-02-11 22:38]:
> >  > > On Sat, Feb 11, 2006 at 09:47:34PM +0100, Nico Golde wrote:
> >  > >  > Hi,
> >  > >  > at the moment I try to get the current cpu frequency
> >  > >  > P.S. Please CC me, I am not subsribed, thanks
> >  > > 
> >  > > Are you trying to do this from a userspace program ?
> >  > > If so, this isn't going to work.
> >  > 
> >  > Yes I am.
> > 
> > Read it from sysfs or /proc/cpuinfo.
> 
> Thats exactly what I dont wanted to do and thought its 
> possible without reading a file. So it seems to be not, 
> thank you will use sysfs to get the information.
> Regards Nico

there's still libcpufreq from cpufrequtils if you wish some kind of
abstraction over reading a file.

-- 
mattia
:wq!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-12  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-11 20:47 Getting cpu frequency Nico Golde
2006-02-11 21:37 ` Dave Jones
2006-02-11 21:42   ` Nico Golde
2006-02-11 22:13     ` Dave Jones
2006-02-11 22:16       ` Nico Golde
2006-02-12  8:46         ` Mattia Dongili

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.