[openib-general] cycles_to_units is incorrect in rdma_lat, rdma_bw.

Grant Grundler iod00d at hp.com
Fri Jun 10 08:24:40 PDT 2005


On Thu, Jun 09, 2005 at 10:17:33PM -0700, Shirley Ma wrote:
> > Please provide "cat /proc/cpuinfo" output so I can rule out
> > broken firmware and look for something else.
> 
> processor       : 0
> cpu             : PPC970, altivec supported
> clock           : 1600.000000MHz
> revision        : 2.2

Ah no wonder...every other arch uses "cpu MHz".

> I modified the get_cpu_mhz() to for PPC. 
>         rc = sscanf(buf, "clock : %lf", &m);

Is 1600Mhz correct? I'm assuming it is.
Does the attached patch work for you?

It will allow PPC to change to "cpu MHz" and it will still work.
Or accomodate other arches that might have cloned PPC code.

grant

Index: get_clock.c
===================================================================
--- get_clock.c	(revision 2572)
+++ get_clock.c	(working copy)
@@ -48,8 +48,11 @@
 		double m;
 		int rc;
 		rc = sscanf(buf, "cpu MHz : %lf", &m);
-		if (rc != 1)
-			continue;
+		if (rc != 1) {	/* blech...PPC does it different */
+			rc = sscanf(buf, "clock : %lf", &m);
+			if (rc != 1)
+				continue;
+		}
 		if (mhz == 0.0) {
 			mhz = m;
 			continue;



More information about the general mailing list