On Tue, Nov 06, 2007 at 04:59:59PM -0800, Bernard Li wrote:
> Got a quick question about multicpu.conf -- by default, this is
> installed with the RPM and enabled, should it be?
> 
> Because apparently, the kernel which comes with CentOS 4 does not
> support it, as I get the following syslog message when I start gmond:
> 
> GMOND[31539]: slurpfile() open() error on file
> /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or
> directory

I don't think that error is linked to the "multicpu" module directly,
but the fact that the kernel doesn't have "cpufreq" ACPI governor loaded, and
therefore there is an error since your changes in r815 to lib/file.c for any
related metric.

> We might have discussed this issue previously, so I apologize in
> advance if I missed the answer.

looking at the archive it might seem that this issue was raised in :

http://www.mail-archive.com/ganglia-developers@lists.sourceforge.net/msg02945.html

but the additional fix was never tested/deployed

attached a fix that was tested working in my athlon64 laptop running gentoo
linux 2007.0 with and without powernow-k8.  a similar fix will need to be done
for the multicpu code unless changes in r815 are reverted and then we go back
to slurpfile silent to errors (but leaving that to the caller as being used
everywhere else).

Carlo
Index: metrics.c
===================================================================
--- metrics.c   (revision 859)
+++ metrics.c   (working copy)
@@ -164,13 +164,16 @@
 {
    g_val_t rval;
    char * dummy;
+   struct stat struct_stat;
 
    num_cpustates = num_cpustates_func();
 
-   cpufreq = 1;
-   rval.int32 = 
slurpfile("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", 
sys_devices_system_cpu, BUFFSIZE);
-   if ( rval.int32 == SYNAPSE_FAILURE )
-      cpufreq = 0;
+   cpufreq = 0;
+   /* scaling_max_freq will contain the max CPU speed */
+   if ( stat("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", 
&struct_stat) == 0 ) {
+      cpufreq = 1;
+      rval.int32 = 
slurpfile("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", 
sys_devices_system_cpu, BUFFSIZE);
+   }
 
    rval.int32 = slurpfile("/proc/cpuinfo", proc_cpuinfo, BUFFSIZE);
    if ( rval.int32 == SYNAPSE_FAILURE )
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to