[netperf-dev] netperf4 commit notice r186 - in trunk: . src

raj at netperf.org raj at netperf.org
Wed Jun 28 14:49:04 PDT 2006


Author: raj
Date: 2006-06-28 14:49:01 -0700 (Wed, 28 Jun 2006)
New Revision: 186

Added:
   trunk/src/netlib_kstat10.c
   trunk/src/netsysstats_kstat10.c
Modified:
   trunk/README.solaris
Log:
Initial Solaris 10 port

Modified: trunk/README.solaris
===================================================================
--- trunk/README.solaris	2006-06-22 18:10:13 UTC (rev 185)
+++ trunk/README.solaris	2006-06-28 21:49:01 UTC (rev 186)
@@ -1 +1,31 @@
-Netperf4 has yet to be compiled on any flavor of Solaris.
\ No newline at end of file
+An initial port of netperf to Solaris 10 has been completed, using
+the "null" files for CPU affinity and CPU utilization.  Later work
+will focus on getting "native" versions of those files into the mix.
+
+Netperf4's glib-2.0 dependency is not satisfied by the bits provided
+by Sun as they are old enough to not have the gstdio.h include.
+
+An attempt to use packages from sunfreeware was unsuccessful as their
+glib seems to be missing the glibconfig.h file, or puts it in some 
+obscure place.
+
+The attempt to use packages from blastwave.org was successful.  The
+glib-2.0, libxml2 and pkgconfig packages were used.  It is possible
+the libxml2 bits provided with the OS would suffice, but the author
+did not want to try to figure-out how to use glib-2.0 from one set of 
+packages and libxml2 from another.  One little issue though was the 
+gmodule-2.0.pc file from blastwave.org had a "blank" Cflags: entry which 
+appears to annoy pkg-config.  This was addressed by taking the Cflags:
+entry from glib-2.0.pc and sticking that into gmodule-2.0.pc (all in the CSW
+versions of course...)
+
+The configuration command used was:
+
+CC="cc" CFLAGS="-D_REENTRANT" ./configure --prefix=/opt/netperf4
+
+while the PATH was:
+
+/opt/csw/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/opt/SUNWspro/bin:/usr/ccs/bin
+
+cc was selected over gcc - an initial attempt to compile with gcc seems
+to have led to ld errors - perhaps not using the correct ld.

Added: trunk/src/netlib_kstat10.c
===================================================================
--- trunk/src/netlib_kstat10.c	2006-06-22 18:10:13 UTC (rev 185)
+++ trunk/src/netlib_kstat10.c	2006-06-28 21:49:01 UTC (rev 186)
@@ -0,0 +1,86 @@
+static char netlib_specific_id[]="\
+@(#)(c) Copyright 2006, Hewlett-Packard Company, $Id: netlib_none.c 180 2006-05-24 20:02:03Z raj $";
+
+/*
+
+This file is part of netperf4.
+
+Netperf4 is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2 of the License, or (at your
+option) any later version.
+
+Netperf4 is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
+
+In addition, as a special exception, the copyright holders give
+permission to link the code of netperf4 with the OpenSSL project's
+"OpenSSL" library (or with modified versions of it that use the same
+license as the "OpenSSL" library), and distribute the linked
+executables.  You must obey the GNU General Public License in all
+respects for all of the code used other than "OpenSSL".  If you modify
+this file, you may extend this exception to your version of the file,
+but you are not obligated to do so.  If you do not wish to do so,
+delete this exception statement from your version.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "netperf.h"
+
+int
+set_thread_locality(void  *threadid, char *loc_type, char *loc_value, int debug, FILE *where) {
+  NETPERF_DEBUG_ENTRY(debug,where);
+  if (debug) {
+    fprintf(where,
+	    "No call to set CPU affinity available, request ignored.\n");
+    fflush(where);
+  }
+  NETPERF_DEBUG_EXIT(debug,where);
+  return(NPE_SUCCESS);
+}
+
+int
+set_test_locality(test_t *test, char *loc_type, char *loc_value)
+{
+
+  NETPERF_DEBUG_ENTRY(test->debug,test->where);
+
+  if (test->debug) {
+    fprintf(test->where,
+	    "No call to set CPU affinity available, request ignored.\n");
+    fflush(test->where);
+  }
+
+  NETPERF_DEBUG_EXIT(test->debug,test->where);
+
+  return(NPE_SUCCESS);
+}
+
+int 
+set_own_locality(char *loc_type, char *loc_value, int debug, FILE *where) {
+  int my_id = 0;
+
+  return(set_thread_locality((void *)&my_id,
+			     loc_type,
+			     loc_value,
+			     debug,
+			     where));
+}
+
+int
+clear_own_locality(char *loc_type, int debug, FILE *where){
+
+  return(NPE_SUCCESS);
+
+}

Added: trunk/src/netsysstats_kstat10.c
===================================================================
--- trunk/src/netsysstats_kstat10.c	2006-06-22 18:10:13 UTC (rev 185)
+++ trunk/src/netsysstats_kstat10.c	2006-06-28 21:49:01 UTC (rev 186)
@@ -0,0 +1,92 @@
+char netsysstats_none[]="\
+@(#)(c) Copyright 2006, Hewlett-Packard Company, $Id: netsysstats_none.c 180 2006-05-24 20:02:03Z raj $";
+
+/*
+
+This file is part of netperf4.
+
+Netperf4 is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2 of the License, or (at your
+option) any later version.
+
+Netperf4 is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
+
+In addition, as a special exception, the copyright holders give
+permission to link the code of netperf4 with the OpenSSL project's
+"OpenSSL" library (or with modified versions of it that use the same
+license as the "OpenSSL" library), and distribute the linked
+executables.  You must obey the GNU General Public License in all
+respects for all of the code used other than "OpenSSL".  If you modify
+this file, you may extend this exception to your version of the file,
+but you are not obligated to do so.  If you do not wish to do so,
+delete this exception statement from your version.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "netperf.h"
+#include "netsysstats.h"
+
+int
+sys_cpu_util_init(test_t *test) 
+{
+
+  netsysstat_data_t *tsd = GET_TEST_DATA(test);
+
+  NETPERF_DEBUG_ENTRY(test->debug,test->where);
+  tsd->num_cpus = 1;
+  NETPERF_DEBUG_EXIT(test->debug, test->where);
+  return NPE_SUCCESS;
+}
+
+/* slightly kludgy to get the CPU util to come-out as 100% */
+static uint64_t user,kernel,other,interrupt,idle = 0;
+
+void
+get_cpu_time_counters(cpu_time_counters_t *res,
+		      struct timeval *timestamp,
+		      test_t *test)
+{
+  int i;
+  netsysstat_data_t *tsd = GET_TEST_DATA(test);
+
+
+  NETPERF_DEBUG_ENTRY(test->debug,test->where);
+
+  gettimeofday(timestamp,NULL);
+
+  /* this should result in the CPU util being forever reported as
+     100% */
+
+  user += 10000;
+  kernel += 10000;
+  interrupt += 10000;
+  idle += 1;
+
+  for (i = 0; i < tsd->num_cpus; i++) {
+    res[i].user = user;
+    res[i].kernel = kernel;
+    res[i].interrupt = interrupt;
+    res[i].idle = idle;
+    res[i].calibrate = res[i].user +
+      res[i].kernel +
+      res[i].interrupt +
+      res[i].idle;
+    res[i].other = 0;
+  }
+
+  NETPERF_DEBUG_EXIT(test->debug, test->where);
+
+}



More information about the netperf-dev mailing list