Click to See Complete Forum and Search --> : longrun doesn't recognize my cpuid..
ooagentbender
07-14-2004, 01:19 AM
when I run
longrun -f performance
I get
can't open /dev/cpu/0/cpuid no such device or address
I was wondering how I would correct this since I looked in that directory and there is a folder with that name and i chmodded it to 777 just to be sure and it still didn't work.
Anyway if anyone could help me out with this I would be grateful.
bwkaz
07-14-2004, 09:55 PM
Turn on CONFIG_X86_CPUID in your kernel configuration (in menuconfig, it's Processor type and features --> /dev/cpu/*/cpuid - CPU information support). Or, you might try doing an /sbin/modprobe cpuid (but I'm not sure if that's the module name or not).
Whether you have the device node or not, you need the kernel support for that device node built and loaded. ;)
ooagentbender
07-15-2004, 01:25 AM
how do I check to see if its compiled into the kernel?
how do I check to see if its compiled into the kernel?
Go to /usr/src/linux and do make menuconfig or look in the .config file in that directory. (Maybe "cat .config | grep CONFIG_X86_CPUID" outputs something usefull.)
In KDE there's a utility that let's you check the kernel configuration from a grafical interface.
ooagentbender
07-15-2004, 07:17 AM
theres no menuconfig file in that directory, any suggestions?
It should work if you type "make menuconfig" from a terminal and when you're in that directory.
You can also view the .config file in that directory with a editor like kedit. Open Kedit from the K/start menu, then choose open, go to that directory, type .config and open it.
bwkaz
07-15-2004, 07:23 PM
make menuconfig does not require a file named "menuconfig". That's not the way that make works. ;) You should really be looking in /lib/modules/$(uname -r)/build, though, for your .config file -- /usr/src/linux is not guaranteed to be your current kernel source tree. The above /lib/modules directory is.
But if you don't have any kernel sources at all, then you can tell by looking around in /lib/modules/<kernel version> for a file that's named something like cpuid. If it's there, modprobe it (remove the .o or .ko part first, so if the file is cpuid.ko, then just modprobe cpuid). If you can't find it, then since your kernel doesn't have a driver for those files, then it was obviously turned off when your kernel was configured.
ooagentbender
07-20-2004, 02:29 PM
Ok I got everything compiled in and I modprobed cpuid. Then I tried useing the longrun utility but it said error reading /dev/cpu/0/msr. So I tried modprobing msr and that works only to tell me, when I run the longrun utility that it can't read cpuid. After doing both in random orders many times it never seems to work. Anyone?
thanks
bwkaz
07-20-2004, 06:40 PM
Exactly which error did it give you? If "Permission denied", then you need to modify the permissions on the relevant files.
If it gave you a different error, post it, exactly.
ooagentbender
07-21-2004, 05:09 AM
it said exactly what I typed above
longrun: error reading /dev/cpu/0/cpuid: Invalid argument
hope that helps I would really like to be able to adjust that setting. I also plan on making a little java app (becaus learning the api for c or c++ doesn't sound like much fun) that shows what your in and has some basic buttons for changing. Or I might just map some keys to it. Anyway, any help with this would be appreciated.
bwkaz
07-21-2004, 06:43 PM
Originally posted by ooagentbender
longrun: error reading /dev/cpu/0/cpuid: Invalid argument Ah, that makes a LOT more sense. Basically, when longrun was trying to do something with /dev/cpu/0/cpuid, the kernel returned -EINVAL (that's what the "Invalid argument" string means).
Now, the only functions in the kernel cpuid driver (arch/i386/kernel/cpuid.c) that return -EINVAL are the implementations of lseek (called by the glibc fseek, lseek, and fseeko functions) and read (called by any glibc function that reads from a file).
lseek returns -EINVAL if its "orig" (that is, origin) parameter is not 0 or 1 -- 0 is SEEK_SET (seek to "offset" bytes from the beginning of the file) and 1 is SEEK_CUR (seek to "offset" bytes from the current file position). If the program calls one of the seek() functions and passes something other than SEEK_SET or SEEK_CUR (the only other option is SEEK_END), then it'll get a -EINVAL.
read() returns -EINVAL if the buffer size is not a multiple of 16. I think this is probably more likely, but I'd need to see the code for longrun to be sure.
Wait a minute -- according to Freshmeat's longrun page, it requires a Transmeta Crusoe processor. Do you have one of those specifically? I'm not sure that it'll run on a P4 or Athlon; I think you need a chip from Transmeta.
ooagentbender
07-22-2004, 03:36 PM
lol yes I have a crusoe processor. So was fiddling a bit and I looked at /proc/cpuinfo and it says this
...
cpuid level : 1
...
I was wondering if that meant that the cpuid was in /dev/cpu/1/cpuid so I tried using
longrun -c /dev/cpu/1/cpuid
to set the cpuid but it gave me
longrun permission denied.
so I chmoded everythin /dev/cpu/1 to 777 just to be sure but I still get permission denied.
anyone?
Im not even sure that the cpuid level thing means that it uses /dev/cpu/1/cpuid.
bwkaz
07-22-2004, 06:43 PM
No, the cpuid level is just a measure of which "version" of the cpuid instruction the processor supports.
It's also a limit on where any userspace program can lseek() to -- and it seems that longrun is trying to seek waaaay past this limit. I would guess that that's the problem, though I don't know for sure...
ooagentbender
07-24-2004, 06:18 AM
so how do I fix that? anyone out there?
bwkaz
07-24-2004, 09:02 AM
No idea. Maybe see if the longrun developer knows why it might be happening?