the following proposed patch for stable (3.0) fixes bug 160 in FreeBSD which
will result in invalid values for the cpu_speed metric in 32bit systems with
clocks higher than 2G Hz which load the cpufreq driver as detailed in :

  http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=160

attached original fix committed as r909

Carlo

---
Index: libmetrics/freebsd/metrics.c
===================================================================
--- libmetrics/freebsd/metrics.c        (revision 908)
+++ libmetrics/freebsd/metrics.c        (revision 909)
@@ -160,7 +160,8 @@
    char buf[1024];
    char *curptr;
    size_t len;
-   long freq = 0, tmpfreq;
+   uint32_t freq = 0, tmpfreq;
+   uint64_t tscfreq;
 
    /*
     * If the system supports it, the cpufreq driver provides the best
@@ -195,8 +196,9 @@
     * machdep.tsc_freq exists on some i386/amd64 machines and gives the
     * CPU speed in Hz.  If it exists it's a decent value.
     */
-   if (sysctlbyname("machdep.tsc_freq", &tmpfreq, &len, NULL, 0) != -1) {
-      freq = (double)tmpfreq / 1e6;
+   len = sizeof(tscfreq);
+   if (sysctlbyname("machdep.tsc_freq", &tscfreq, &len, NULL, 0) != -1) {
+      freq = (double)tscfreq / 1e6;
       goto done;
    }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to