[netperf-dev] netperf4 commit notice r107 - branches/glib_migration/src

raj at netperf.org raj at netperf.org
Tue Mar 28 15:18:10 PST 2006


Author: raj
Date: 2006-03-28 15:18:08 -0800 (Tue, 28 Mar 2006)
New Revision: 107

Modified:
   branches/glib_migration/src/disktest.c
   branches/glib_migration/src/disktest.h
   branches/glib_migration/src/dsk_commands.xml
   branches/glib_migration/src/dsk_config.xml
   branches/glib_migration/src/netlib.c
   branches/glib_migration/src/netlib_hpux.c
   branches/glib_migration/src/netperf.h
   branches/glib_migration/src/netperf_docs.dtd
   branches/glib_migration/src/netperf_hist.h
   branches/glib_migration/src/nettest_bsd.c
   branches/glib_migration/src/nettest_dns.c
   branches/glib_migration/src/nettest_vst.c
Log:
Merge with the trunk from revsions 81 through 106


Modified: branches/glib_migration/src/disktest.c
===================================================================
--- branches/glib_migration/src/disktest.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/disktest.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -32,19 +32,8 @@
 #ifndef lint
 char    disk_test_id[]="\
 @(#)disktest.c (c) Copyright 2005 Hewlett-Packard Co. $Id: disktest.c 20 2006-2-28 19:45:00Z burger $";
-#else
-#define WANT_HISTOGRAM
 #endif /* lint */
 
-#ifdef WANT_HISTOGRAM
-#define HISTOGRAM_VARS        struct timeval time_one,time_two
-#define HIST_TIMESTAMP(time)  gettimeofday(time,NULL)
-#define HIST_ADD(h,delta)     HIST_add(h,delta)
-#else
-#define HISTOGRAM_VARS       /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,delta)    /* call to add data to histogram goes here */
-#endif
 
 /****************************************************************/
 /*                                                              */
@@ -57,6 +46,13 @@
 
 
 
+/* requires 64 bit file offsets */
+#define _FILE_OFFSET_BITS 64
+
+/* turn on histogram capability */
+#define WANT_HISTOGRAM
+
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -280,8 +276,9 @@
 disk_test_init(test_t *test)
 {
   disk_data_t *new_data;
-  xmlNodePtr  args;
-  xmlChar    *string;
+  xmlNodePtr   args;
+  xmlChar     *string;
+  int          loc_debug = 0;
   
 
   new_data = (disk_data_t *)malloc(sizeof(disk_data_t));
@@ -307,13 +304,23 @@
       new_data->read = 1.0;
     }
 
-    string =  xmlGetProp(args,(const xmlChar *)"chunk");
+    string =  xmlGetProp(args,(const xmlChar *)"disk_io_size");
+    if (test->debug || loc_debug) {
+      fprintf(test->where,
+              "%s:%s  disk_io_size = '%s'\n", test->id, __func__, string);
+      fflush(test->where);
+    }
     if (string) {
       new_data->chunk = strtoul((char *)string,NULL,10);
     } else {
       new_data->chunk = 8;
     }
-    string =  xmlGetProp(args,(const xmlChar *)"chunk_units");
+    string =  xmlGetProp(args,(const xmlChar *)"disk_io_units");
+    if (test->debug || loc_debug) {
+      fprintf(test->where,
+              "%s:%s  disk_io_units = '%s'\n", test->id, __func__, string);
+      fflush(test->where);
+    }
     if (string) {
       if (strstr((char *)string,"KB")) {
         new_data->chunk *= 1024;
@@ -329,13 +336,23 @@
       new_data->chunk *= 1024;
     }
 
-    string =  xmlGetProp(args,(const xmlChar *)"size");
+    string =  xmlGetProp(args,(const xmlChar *)"disk_test_size");
+    if (test->debug || loc_debug) {
+      fprintf(test->where,
+              "%s:%s  disk_test_size = '%s'\n", test->id, __func__, string);
+      fflush(test->where);
+    }
     if (string) {
       new_data->testSize = strtoull((char *)string,NULL,10);
     } else {
       new_data->testSize = 0;
     }
-    string =  xmlGetProp(args,(const xmlChar *)"size_units");
+    string =  xmlGetProp(args,(const xmlChar *)"disk_test_units");
+    if (test->debug || loc_debug) {
+      fprintf(test->where,
+              "%s:%s  disk_test_units = '%s'\n", test->id, __func__, string);
+      fflush(test->where);
+    }
     if (string) {
       if (strstr((char *)string,"KB")) {
         new_data->testSize *= 1024;
@@ -390,7 +407,7 @@
                         DISK_MALLOC_FAILED,
                         "malloc failed in disk_test_init");
   }
-  if (test->debug) {
+  if (test->debug || loc_debug) {
     fprintf(test->where,
             "%s:%s  file_name = '%s'\n", test->id, __func__, 
             new_data->file_name);
@@ -401,6 +418,9 @@
             "%s:%s  chunk = %ld\n", test->id, __func__, 
             new_data->chunk);
     fprintf(test->where,
+            "%s:%s  testSize = %lld\n", test->id, __func__, 
+            new_data->testSize);
+    fprintf(test->where,
             "%s:%s  scsi_immreport = %d\n", test->id, __func__, 
             new_data->scsi_immreport);
     fprintf(test->where,
@@ -409,6 +429,9 @@
     fprintf(test->where, "\n");
     fflush(test->where);
   }
+  
+  new_data->read_hist  = HIST_new();
+  new_data->write_hist = HIST_new();
 
   SET_TEST_DATA(test, new_data);
 }
@@ -442,6 +465,8 @@
   for (i = 0; i < DISK_MAX_COUNTERS; i++) {
     my_data->stats.counter[i] = 0;
   }
+  HIST_CLEAR(my_data->read_hist);
+  HIST_CLEAR(my_data->write_hist);
   my_data->elapsed_time.tv_usec = 0;
   my_data->elapsed_time.tv_sec  = 0;
   gettimeofday(&(my_data->prev_time),NULL);
@@ -465,10 +490,11 @@
 disk_test_get_stats(test_t *test)
 {
   xmlNodePtr  stats = NULL;
+  xmlNodePtr  hist  = NULL;
   xmlAttrPtr  ap    = NULL;
   int         i,j;
-  char        value[32];
-  char        name[32];
+  char        value[64];
+  char        name[64];
   uint64_t    loc_cnt[DISK_MAX_COUNTERS];
 
   disk_data_t *my_data = GET_TEST_DATA(test);
@@ -480,7 +506,7 @@
   }
   if ((stats = xmlNewNode(NULL,(xmlChar *)"test_stats")) != NULL) {
     /* set the properites of the test_stats message -
-       the tid and time stamps/values and counter values  sgb 2004-07-07 */
+       the tid and time stamps/values and counter values  sgb 2006-03-15 */
 
     ap = xmlSetProp(stats,(xmlChar *)"tid",test->id);
     for (i = 0; i < DISK_MAX_COUNTERS; i++) {
@@ -540,6 +566,21 @@
         }
       }
     }
+    /* add hist_stats entries to the status report */
+    if (my_data->stats.named.read_calls > 0) {
+      snprintf(name,32,"DISK_READ test %s",test->id);
+      hist = HIST_stats_node(my_data->read_hist, name);
+      if (hist != NULL) {
+        xmlAddChild(stats,hist);
+      }
+    }
+    if (my_data->stats.named.write_calls > 0) {
+      snprintf(name,63,"DISK_WRITE test %s",test->id);
+      hist = HIST_stats_node(my_data->write_hist, name);
+      if (hist != NULL) {
+        xmlAddChild(stats,hist);
+      }
+    }
     if (ap == NULL) {
       xmlFreeNode(stats);
       stats = NULL;
@@ -562,7 +603,7 @@
   off_t         max_chunk;
   off_t         value;
   char         *buf;
-  int           loc_debug = 1;
+  int           loc_debug = 0;
 
 
   my_data     = GET_TEST_DATA(test);
@@ -589,20 +630,19 @@
 
   /* default end_position */
   if (my_data->end_pos == 0) {
-    if (my_data->start_pos < my_data->devSize) {
-      my_data->end_pos = my_data->testSize -  my_data->start_pos;
+    if (my_data->start_pos < (my_data->devSize - (my_data->chunk * 2))) {
+      my_data->end_pos = my_data->start_pos + my_data->testSize;
     }
     else {
       my_data->end_pos = my_data->testSize;
     }
-    my_data->end_pos = my_data->end_pos = my_data->sectSize;
   }
   
   if (my_data->testSize > my_data->devSize) {
     report_test_failure(test,
                         (char *)__func__,
-                        DISK_SIZE_TO_LARGE,
-                        "size value is larger than device capacity");
+                        DISK_TEST_SIZE_TO_LARGE,
+                        "disk test size is larger than device capacity");
   }
   else if (my_data->start_pos > (my_data->devSize - my_data->testSize)) {
     report_test_failure(test,
@@ -616,12 +656,18 @@
                         DISK_END_POS_TO_LARGE,
                         "end_postion value is past end of device");
   }
-  else if (my_data->chunk > (my_data->testSize/2)) {
+  else if (my_data->end_pos > (my_data->start_pos + my_data->testSize)) {
     report_test_failure(test,
                         (char *)__func__,
                         DISK_END_POS_TO_LARGE,
-                        "end_postion value is past end of device");
+                        "end_postion value is past end of testSize");
   }
+  else if (my_data->chunk > (my_data->testSize/2)) {
+    report_test_failure(test,
+                        (char *)__func__,
+                        DISK_IO_SIZE_TO_LARGE,
+                        "disk io size is too large");
+  }
   my_data->where = my_data->start_pos;
   
   value = sysconf(_SC_PAGE_SIZE);
@@ -630,30 +676,30 @@
   buf = (char *)(((long)buf + (long)value - 1) & ~((long)value -1));
   my_data->buffer_start = buf;
 
-  if (test->debug) {
+  if (test->debug || loc_debug) {
     fprintf(test->where,
-            "%s:%s  testSize = %ld\n", test->id, __func__, 
+            "%s:%s  testSize = %lld\n", test->id, __func__, 
             my_data->testSize);
     fprintf(test->where,
             "%s:%s  chunk = %ld\n", test->id, __func__, 
             my_data->chunk);
     fprintf(test->where,
-            "%s:%s  start_position = %ld\n", test->id, __func__, 
+            "%s:%s  start_position = %lld\n", test->id, __func__, 
             my_data->start_pos);
     fprintf(test->where,
-            "%s:%s  end_position = %ld\n", test->id, __func__, 
+            "%s:%s  end_position = %lld\n", test->id, __func__, 
             my_data->end_pos);
     fprintf(test->where,
-            "%s:%s  devSize = %ld\n", test->id, __func__, 
+            "%s:%s  devSize = %lld\n", test->id, __func__, 
             my_data->devSize);
     fprintf(test->where,
-            "%s:%s  diskSize = %ld\n", test->id, __func__, 
+            "%s:%s  diskSize = %lld\n", test->id, __func__, 
             my_data->diskSize);
     fprintf(test->where,
-            "%s:%s  sectSize = %ld\n", test->id, __func__, 
+            "%s:%s  sectSize = %lld\n", test->id, __func__, 
             my_data->sectSize);
     fprintf(test->where,
-            "%s:%s  where = %ld\n", test->id, __func__, 
+            "%s:%s  where = %lld\n", test->id, __func__, 
             my_data->where);
     fprintf(test->where,
             "%s:%s  buffer_start = %p\n", test->id, __func__, 
@@ -676,6 +722,7 @@
   struct capacity           scsi_capacity;
   capacity_type             capacity;
   int                       ir_flag;
+  int                       loc_debug = 0;
 
 
   my_data     = GET_TEST_DATA(test);
@@ -898,10 +945,9 @@
   xfer_size = my_data->testSize;
   
   if (test->debug) {
-    fprintf(test->where, "%s: debug    = %d\n",  __func__, test->debug);
-    fprintf(test->where, "%s: testSize = %ld\n", __func__, xfer_size);
-    fprintf(test->where, "%s: size     = %ld\n", __func__, size);
-    fprintf(test->where, "%s: where    = %ld\n", __func__, where);
+    fprintf(test->where, "%s: testSize = %lld\n", __func__, xfer_size);
+    fprintf(test->where, "%s: size     = %ld\n",  __func__, size);
+    fprintf(test->where, "%s: where    = %lld\n", __func__, where);
     fflush(test->where);
   }
   if (my_data->read != 0.0) {
@@ -941,8 +987,10 @@
     if (readIO) {
       bytes = io_read(fd, buf_addr, size, test, (char *)__func__);
       if (state == TEST_MEASURE) {
-        HIST_TIMESTAMP(&time_two);
-        HIST_ADD(my_data->read_hist,delta_macro(&time_one,&time_two));
+        if (my_data->read_hist) {
+          HIST_TIMESTAMP(&time_two);
+          HIST_ADD(my_data->read_hist, &time_one, &time_two);
+        }
         my_data->stats.named.read_calls++;
         my_data->stats.named.bytes_read += bytes;
       }
@@ -950,8 +998,10 @@
     else {
       bytes = io_write(fd, buf_addr, size, test, (char *)__func__);
       if (state == TEST_MEASURE) {
-        HIST_TIMESTAMP(&time_two);
-        HIST_ADD(my_data->write_hist,delta_macro(&time_one,&time_two));
+        if (my_data->write_hist) {
+          HIST_TIMESTAMP(&time_two);
+          HIST_ADD(my_data->write_hist, &time_one, &time_two);
+        }
         my_data->stats.named.write_calls++;
         my_data->stats.named.bytes_written += bytes;
       }
@@ -1117,15 +1167,17 @@
         rd->print_test = 1;
       }
       if (!strcmp(report_flags,"PRINT_ALL")) {
-        rd->print_hist = 1;
-        rd->print_run  = 1;
-        rd->print_test = 1;
+        rd->print_hist    = 1;
+        rd->print_run     = 1;
+        rd->print_test    = 1;
+        rd->print_per_cpu = 1;
       }
     }
     if (test_set->debug) {
-      rd->print_hist = 1;
-      rd->print_run  = 1;
-      rd->print_test = 1;
+      rd->print_hist    = 1;
+      rd->print_run     = 1;
+      rd->print_test    = 1;
+      rd->print_per_cpu = 1;
     }
     test_set->report_data = rd;
   }
@@ -1154,7 +1206,7 @@
   double         write_rate;
   double         read_call_rate;
   double         write_call_rate;
-  double         seek_rate;
+  double         seek_call_rate;
 
 #define TST_E_SEC         0
 #define TST_E_USEC        1
@@ -1211,7 +1263,7 @@
   write_rate       = test_cntr[TST_W_BYTES] / (elapsed_seconds*1024.0*1024.0);
   read_call_rate   = test_cntr[TST_R_CALLS] / elapsed_seconds;
   write_call_rate  = test_cntr[TST_W_CALLS] / elapsed_seconds;
-  seek_rate        = test_cntr[TST_S_CALLS] / elapsed_seconds;
+  seek_call_rate   = test_cntr[TST_S_CALLS] / elapsed_seconds;
   iops             = read_call_rate + write_call_rate;
   if (test_set->debug) {
     fprintf(test_set->where,"\tread_rate = %7g\t%7g\n",
@@ -1222,6 +1274,8 @@
             read_call_rate, test_cntr[TST_R_CALLS]);
     fprintf(test_set->where,"\twrite_call_rate = %7g\t%7g\n",
             write_call_rate, test_cntr[TST_W_CALLS]);
+    fprintf(test_set->where,"\tseek_call_rate = %7g\t%7g\n",
+            seek_call_rate, test_cntr[TST_S_CALLS]);
     fflush(test_set->where);
   }
   if (rd->sd_denominator == 0.0) {
@@ -1239,17 +1293,33 @@
   rd->write_iops[index]      += write_call_rate;
   rd->iops[index]            += iops;
 
+  if (rd->print_hist) {
+    xmlNodePtr  hist;
+    hist = stats->xmlChildrenNode;
+    if (hist == NULL) {
+      fprintf(outfd,"%s:No Histogram Node Found\n\n",__func__);
+      fflush(outfd);
+    }
+    while (hist != NULL) {
+      if (!xmlStrcmp(hist->name,(const xmlChar *)"hist_stats")) {
+        HIST_REPORT(outfd, hist);
+      }
+      hist = hist->next;
+    }
+  }
+
   if (rd->print_test) {
     /* Display per test results */
     fprintf(outfd,"%3d  ", count);                    /*  0,5 */
     fprintf(outfd,"%-6s ",  tid);                     /*  5,7 */
     fprintf(outfd,"%-6.2f ",elapsed_seconds);         /* 12,7 */
-      fprintf(outfd,"%7.2f ",iops);                   /* 19,8 */
-      fprintf(outfd,"%7.2f ",read_call_rate);         /* 27.8 */
-      fprintf(outfd,"%7.2f ",write_call_rate);        /* 35,8 */
-      fprintf(outfd,"%7.2f ",read_rate);              /* 43,8 */
-      fprintf(outfd,"%7.2f ",write_rate);             /* 51,8 */
-      fprintf(outfd,"%7.4f ",seek_rate);              /* 59,8 */
+    fprintf(outfd,"%7.2f ",iops);                     /* 19,8 */
+    fprintf(outfd,"%7.2f ",read_call_rate);           /* 27.8 */
+    fprintf(outfd,"%7.2f ",write_call_rate);          /* 35,8 */
+    fprintf(outfd,"%7.2f ",read_rate);                /* 43,8 */
+    fprintf(outfd,"%7.2f ",write_rate);               /* 51,8 */
+    fprintf(outfd,"%7.4f ",seek_call_rate);           /* 59,8 */
+    fprintf(outfd,"%7.2f ",iops/seek_call_rate);      /* 67,8 */
     fprintf(outfd,"\n");
     fflush(outfd);
   }
@@ -1259,17 +1329,17 @@
 static double
 process_sys_stats(tset_t *test_set, xmlNodePtr stats, xmlChar *tid)
 {
-  int            i;
-  int            count;
-  int            index;
-  FILE          *outfd;
+  int             i;
+  int             count;
+  int             index;
+  FILE           *outfd;
   disk_results_t *rd;
-  double         elapsed_seconds;
-  double         sys_util;
-  double         calibration;
-  double         local_idle;
-  double         local_busy;
-  double         local_cpus;
+  double          elapsed_seconds;
+  double          sys_util;
+  double          calibration;
+  double          local_idle;
+  double          local_busy;
+  double          local_cpus;
 
 #define MAX_SYS_CNTRS 10
 #define E_SEC         0
@@ -1337,6 +1407,34 @@
     fflush(test_set->where);
   }
   rd->utilization[index]  += local_busy;
+
+  if (rd->print_per_cpu) {
+    xmlNodePtr  cpu;
+    char       *value_str;
+
+    cpu = stats->xmlChildrenNode;
+    while (cpu != NULL) {
+      if (!xmlStrcmp(cpu->name,(const xmlChar *)"per_cpu_stats")) {
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"cpu_id");
+        fprintf(outfd,"  cpu%2s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"calibration");
+        fprintf(outfd,"%s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"idle_count");
+        fprintf(outfd,"%s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"user_count");
+        fprintf(outfd,"%s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"sys_count");
+        fprintf(outfd,"%s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"int_count");
+        fprintf(outfd,"%s ", value_str);
+        value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"other_count");
+        fprintf(outfd,"%s\n", value_str);
+        fflush(outfd);
+      }
+      cpu = cpu->next;
+    }
+  }
+
   if (rd->print_test) {
     /* Display per test results */
     fprintf(outfd,"%3d  ", count);                    /*  0,5 */
@@ -1484,7 +1582,7 @@
   disk_results_t *rd;
   double          confidence;
   double          temp;
-  int             loc_debug = 1;
+  int             loc_debug = 0;
 
   rd        = test_set->report_data;
 
@@ -1519,7 +1617,7 @@
                                       &(test_set->confidence),
                                       &(rd->ave_time),
                                       &(temp));
-  rd->iops_confidence         = get_confidence(rd->iops,
+  rd->iops_confidence           = get_confidence(rd->iops,
                                       &(test_set->confidence),
                                       &(rd->iops_measured_mean),
                                       &(rd->iops_interval));
@@ -1565,23 +1663,27 @@
   if (rd->service_demand_confidence > confidence) {
     confidence = rd->service_demand_confidence;
   }
-  if (rd->write_confidence > confidence) {
-    confidence = rd->write_confidence;
+  if (rd->write_measured_mean > 0.0) {
+    if (rd->write_confidence > confidence) {
+      confidence = rd->write_confidence;
+    }
   }
-  if (rd->read_confidence > confidence) {
-    confidence = rd->read_confidence;
+  if (rd->read_measured_mean > 0.0) {
+    if (rd->read_confidence > confidence) {
+      confidence = rd->read_confidence;
+    }
   }
 
   if (test_set->confidence.min_count > 1) {
     test_set->confidence.value = test_set->confidence.interval - confidence;
+    if (test_set->debug || loc_debug) {
+      fprintf(test_set->where,
+              "\t%3d run confidence = %.2f%%\tcheck value = %f\n",
+              test_set->confidence.count,
+              100.0 * confidence, test_set->confidence.value);
+      fflush(test_set->where);
+    }
   }
-  if (test_set->debug || loc_debug) {
-    fprintf(test_set->where,
-            "\t%3drun confidence = %.2f%%\tcheck value = %f\n",
-            test_set->confidence.count,
-            100.0 * confidence, test_set->confidence.value);
-    fflush(test_set->where);
-  }
   NETPERF_DEBUG_EXIT(test_set->debug,test_set->where);
 }
 
@@ -1619,39 +1721,55 @@
   /* Display per run header */
   fprintf(outfd,"\n");
   for (i=0;i < HDR_LINES; i++) {
-    fprintf(outfd,"%-3s ",field1[i]);                         /*  0,4 */
-    fprintf(outfd,"%-4s ",field2[i]);                         /*  4,5 */
-    fprintf(outfd,"%-6s ",field3[i]);                         /*  9,7 */
-    fprintf(outfd,"%7s ",field4[i]);                          /* 16,8 */
-    fprintf(outfd,"%6s ",field5[i]);                          /* 23,7 */
-    fprintf(outfd,"%6s ",field6[i]);                          /* 31,7 */
-    fprintf(outfd,"%6s ",field7[i]);                          /* 38,7 */
-    fprintf(outfd,"%6s ",field8[i]);                          /* 45,7 */
+    fprintf(outfd,"%-3s ",field1[i]);                         /*  0,4  */
+    fprintf(outfd,"%-4s ",field2[i]);                         /*  4,5  */
+    fprintf(outfd,"%-6s ",field3[i]);                         /*  9,7  */
+    fprintf(outfd,"%9s ",field4[i]);                          /* 16,10 */
+    if (rd->read_results[index] > 0.0) {
+      fprintf(outfd,"%7s ",field5[i]);                        /* 26,8  */
+    }
+    if (rd->write_results[index] > 0.0) {
+      fprintf(outfd,"%7s ",field6[i]);                        /* 34,8  */
+    }
+    fprintf(outfd,"%7s ",field7[i]);                          /* 42,8  */
+    fprintf(outfd,"%7s ",field8[i]);                          /* 45,8  */
     if (index > 0) {
-      fprintf(outfd,"%5s ",field9[i]);                        /* 52,6 */
-      fprintf(outfd,"%5s ",field10[i]);                       /* 58,6 */
-      fprintf(outfd,"%5s ",field11[i]);                       /* 64,6 */
-      fprintf(outfd,"%6s ",field12[i]);                       /* 70,7 */
-      fprintf(outfd,"%6s ",field13[i]);                       /* 77,7 */
+      fprintf(outfd,"%6s ",field9[i]);                        /* 52,7  */
+      if (rd->read_results[index] > 0.0) {
+        fprintf(outfd,"%6s ",field10[i]);                     /* 58,7  */
+      }
+      if (rd->write_results[index] > 0.0) {
+        fprintf(outfd,"%6s ",field11[i]);                     /* 64,7  */
+      }
+      fprintf(outfd,"%7s ",field12[i]);                       /* 70,8  */
+      fprintf(outfd,"%7s", field13[i]);                       /* 87,8  */
     }
     fprintf(outfd,"\n");
   }
 
   /* Display per run results */
-  fprintf(outfd,"%-3d ", count);                              /*  0,4 */
-  fprintf(outfd,"%-4s ",test_set->id);                        /*  4,5 */
-  fprintf(outfd,"%-6.2f ",rd->run_time[index]);               /*  9,7 */
-  fprintf(outfd,"%7.2f ",rd->iops[index]);                    /* 16,8 */
-  fprintf(outfd,"%6.1f ",rd->read_results[index]);            /* 24,7 */
-  fprintf(outfd,"%6.1f ",rd->write_results[index]);           /* 31,7 */
-  fprintf(outfd,"%6.4f ",rd->utilization[index]);             /* 38,7 */
-  fprintf(outfd,"%6.3f ",rd->servdemand[index]);              /* 45,7 */
+  fprintf(outfd,"%-3d ", count);                              /*  0,4  */
+  fprintf(outfd,"%-4s ",test_set->id);                        /*  4,5  */
+  fprintf(outfd,"%-6.2f ",rd->run_time[index]);               /*  9,7  */
+  fprintf(outfd,"%9.2f ",rd->iops[index]);                    /* 16,10 */
+  if (rd->read_results[index] > 0.0) {
+    fprintf(outfd,"%7.2f ",rd->read_results[index]);          /* 26,8  */
+  }
+  if (rd->write_results[index] > 0.0) {
+    fprintf(outfd,"%7.2f ",rd->write_results[index]);         /* 34,8  */
+  }
+  fprintf(outfd,"%7.5f ",rd->utilization[index]);             /* 42,8  */
+  fprintf(outfd,"%7.3f ",rd->servdemand[index]);              /* 50,8  */
   if (index > 0) {
-    fprintf(outfd,"%5.2f ",rd->iops_interval);                /* 52,6 */
-    fprintf(outfd,"%5.1f ",rd->read_interval);                /* 58,6 */
-    fprintf(outfd,"%5.1f ",rd->write_interval);               /* 64,6 */
-    fprintf(outfd,"%6.4f ",rd->cpu_util_interval);            /* 70,7 */
-    fprintf(outfd,"%6.3f ",rd->service_demand_interval);      /* 77,7 */
+    fprintf(outfd,"%6.2f ",rd->iops_interval);                /* 58,7  */
+    if (rd->read_results[index] > 0.0) {
+      fprintf(outfd,"%6.3f ",rd->read_interval);              /* 65,7  */
+    }
+    if (rd->write_results[index] > 0.0) {
+      fprintf(outfd,"%6.3f ",rd->write_interval);             /* 72,7  */
+    }
+    fprintf(outfd,"%7.5f ",rd->cpu_util_interval);            /* 79,8  */
+    fprintf(outfd,"%7.4f", rd->service_demand_interval);      /* 87,8  */
   }
   fprintf(outfd,"\n");
   fflush(outfd);
@@ -1681,14 +1799,18 @@
   fprintf(outfd,
           "!!! must be investigated before going further.\n");
   fprintf(outfd,
-          "!!! Confidence intervals: RESULT     : %6.2f%%\n",
+          "!!! Confidence intervals: IOP_RATE   : %6.2f%%\n",
           100.0 * rd->iops_confidence);
-  fprintf(outfd,
-          "!!! Confidence intervals: RESULT     : %6.2f%%\n",
+  if (rd->read_measured_mean > 0.0) {
+    fprintf(outfd,
+          "!!! Confidence intervals: READ_RATE  : %6.2f%%\n",
           100.0 * rd->read_confidence);
-  fprintf(outfd,
-          "!!! Confidence intervals: RESULT     : %6.2f%%\n",
+  }
+  if (rd->write_measured_mean > 0.0) {
+    fprintf(outfd,
+          "!!! Confidence intervals: WRITE_RATE : %6.2f%%\n",
           100.0 * rd->write_confidence);
+  }
   fprintf(outfd,
           "!!!                       CPU util   : %6.2f%%\n",
           100.0 * rd->cpu_util_confidence);
@@ -1729,36 +1851,44 @@
   /* Print the summary header */
   fprintf(outfd,"\n");
   for (i = 0; i < HDR_LINES; i++) {
-    fprintf(outfd,"%-3s ",field1[i]);                             /*  0,4 */
-    fprintf(outfd,"%-4s ",field2[i]);                             /*  4,5 */
-    fprintf(outfd,"%-6s ",field3[i]);                             /*  9,7 */
-    fprintf(outfd,"%7s ",field4[i]);                              /* 16,8 */
-    fprintf(outfd,"%5s ",field5[i]);                              /* 24,6 */
-    fprintf(outfd,"%6s ",field6[i]);                              /* 30,7 */
-    fprintf(outfd,"%5s ",field7[i]);                              /* 37,6 */
-    fprintf(outfd,"%6s ",field8[i]);                              /* 43,7 */
-    fprintf(outfd,"%5s ",field9[i]);                              /* 50,6 */
-    fprintf(outfd,"%6s ",field10[i]);                             /* 56,7 */
-    fprintf(outfd,"%6s ",field11[i]);                             /* 63,7 */
-    fprintf(outfd,"%6s ",field12[i]);                             /* 70,7 */
-    fprintf(outfd,"%6s ",field13[i]);                             /* 77,7 */
+    fprintf(outfd,"%-3s ",field1[i]);                             /*  0,4  */
+    fprintf(outfd,"%-4s ",field2[i]);                             /*  4,5  */
+    fprintf(outfd,"%-6s ",field3[i]);                             /*  9,7  */
+    fprintf(outfd,"%9s ",field4[i]);                              /* 16,10 */
+    fprintf(outfd,"%6s ",field5[i]);                              /* 26,7  */
+    if (rd->read_measured_mean > 0.0) {
+      fprintf(outfd,"%7s ",field6[i]);                            /* 33,8  */
+      fprintf(outfd,"%6s ",field7[i]);                            /* 41,7  */
+    }
+    if (rd->write_measured_mean > 0.0) {
+      fprintf(outfd,"%7s ",field8[i]);                            /* 48,8  */
+      fprintf(outfd,"%6s ",field9[i]);                            /* 56,7  */
+    }
+    fprintf(outfd,"%7s ",field10[i]);                             /* 65,8  */
+    fprintf(outfd,"%7s ",field11[i]);                             /* 73,8  */
+    fprintf(outfd,"%7s ",field12[i]);                             /* 81,8  */
+    fprintf(outfd,"%7s", field13[i]);                             /* 89,8  */
     fprintf(outfd,"\n");
   }
 
   /* print the summary results line */
-  fprintf(outfd,"A%-2d ",test_set->confidence.count);             /*  0,4 */
-  fprintf(outfd,"%-4s ",test_set->id);                            /*  4,5 */
-  fprintf(outfd,"%-6.2f ",rd->ave_time);                          /*  9,7 */
-  fprintf(outfd,"%7.0f ",rd->iops_measured_mean);                 /* 16,8 */
-  fprintf(outfd,"%5.2f ",rd->iops_interval);                      /* 24,6 */
-  fprintf(outfd,"%6.1f ",rd->read_measured_mean);                 /* 30,7 */
-  fprintf(outfd,"%5.1f ",rd->read_interval);                      /* 37,6 */
-  fprintf(outfd,"%6.1f ",rd->write_measured_mean);                /* 43,7 */
-  fprintf(outfd,"%5.1f ",rd->write_interval);                     /* 50,6 */
-  fprintf(outfd,"%6.4f ",rd->cpu_util_measured_mean);             /* 56,7 */
-  fprintf(outfd,"%6.4f ",rd->cpu_util_interval);                  /* 63,7 */
-  fprintf(outfd,"%6.3f ",rd->service_demand_measured_mean);       /* 70,7 */
-  fprintf(outfd,"%6.3f ",rd->service_demand_interval);            /* 77,7 */
+  fprintf(outfd,"A%-2d ",test_set->confidence.count);             /*  0,4  */
+  fprintf(outfd,"%-4s ",test_set->id);                            /*  4,5  */
+  fprintf(outfd,"%-6.2f ",rd->ave_time);                          /*  9,7  */
+  fprintf(outfd,"%9.2f ",rd->iops_measured_mean);                 /* 16,10 */
+  fprintf(outfd,"%6.2f ",rd->iops_interval);                      /* 26,7  */
+  if (rd->read_measured_mean > 0.0) {
+    fprintf(outfd,"%7.2f ",rd->read_measured_mean);               /* 33,8  */
+    fprintf(outfd,"%6.3f ",rd->read_interval);                    /* 41,7  */
+  }
+  if (rd->write_measured_mean > 0.0) {
+    fprintf(outfd,"%7.2f ",rd->write_measured_mean);              /* 48,8  */
+    fprintf(outfd,"%6.3f ",rd->write_interval);                   /* 56,7  */
+  }
+  fprintf(outfd,"%7.5f ",rd->cpu_util_measured_mean);             /* 65,8  */
+  fprintf(outfd,"%7.5f ",rd->cpu_util_interval);                  /* 73,8  */
+  fprintf(outfd,"%7.3f ",rd->service_demand_measured_mean);       /* 81,8  */
+  fprintf(outfd,"%7.4f", rd->service_demand_interval);            /* 89,8  */
   fprintf(outfd,"\n");
   fflush(outfd);
 }

Modified: branches/glib_migration/src/disktest.h
===================================================================
--- branches/glib_migration/src/disktest.h	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/disktest.h	2006-03-28 23:18:08 UTC (rev 107)
@@ -69,6 +69,7 @@
 typedef struct  disk_results_data {
   int     max_count;
   int     print_hist;
+  int     print_per_cpu;
   int     print_test;
   int     print_run;
   FILE   *outfd;
@@ -108,7 +109,8 @@
   DISK_MAX_ERROR = -32,
   DISK_XMLSETPROP_ERROR,
   DISK_XMLNEWNODE_ERROR,
-  DISK_SIZE_TO_LARGE,
+  DISK_IO_SIZE_TO_LARGE,
+  DISK_TEST_SIZE_TO_LARGE,
   DISK_START_POS_TO_LARGE,
   DISK_END_POS_TO_LARGE,
   DISK_TEST_STAT_FAILED,

Modified: branches/glib_migration/src/dsk_commands.xml
===================================================================
--- branches/glib_migration/src/dsk_commands.xml	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/dsk_commands.xml	2006-03-28 23:18:08 UTC (rev 107)
@@ -4,20 +4,23 @@
 
 <!-- 30 second raw_seq_disk_io test
  -->
-  <create_test_set set_name="s0" tests_in_set="t1" />
-  <wait tid="s0" seconds="120" />
+  <create_test_set set_name="s0" tests_in_set="t0,t1" />
+  <wait tid="s0" />
   <load tid="s0" />
-  <wait tid="s0" seconds="120" />
+  <wait tid="s0" />
   <measure tid="s0" />
   <wait tid="s0" seconds="30" />
   <load tid="s0" />
-  <wait tid="s0" seconds="120" />
+  <wait tid="s0" />
   <get_stats tid="s0" />
+  <wait tid="s0" />
   <clear_stats tid="s0" />
   <idle tid="s0" />
   <wait tid="s0" />
   <report_stats test_set="s0" 
     library="disktest.la"
-    function="report_disk_test_results" />
+    function="report_disk_test_results"
+    report_flags="PRINT_ALL"
+  />
 
 </commands>

Modified: branches/glib_migration/src/dsk_config.xml
===================================================================
--- branches/glib_migration/src/dsk_config.xml	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/dsk_config.xml	2006-03-28 23:18:08 UTC (rev 107)
@@ -2,19 +2,19 @@
 <!DOCTYPE netperf SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >        
 <netperf xmlns="http://www.netperf.org/ns/netperf">
 <!-- This is just another boring comment -->
-<netserver nid="n1"
-  remote_host = "223.0.14.101" >
-<!-- comment out sys_stats test for now
+<netserver nid="n1" >
+<!-- test to get cpu utilization -->
   <test tid="t0"
     test_name = "sys_stats"
     library   = "netsysstats.la" >
   </test>
- -->
+<!-- test to do raw sequential disk io i
+     you must place a valid raw disk file in file_name  -->
   <test tid="t1"
     test_name = "raw_seq_disk_io"
     library   = "disktest.la" >
     <disk_args
-      file_name = "/dev/rdsk/c4t6d0"  />
+      file_name = "/dev/rdsk/junk"  />
   </test>
 </netserver>
 </netperf>

Modified: branches/glib_migration/src/netlib.c
===================================================================
--- branches/glib_migration/src/netlib.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/netlib.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -143,10 +143,244 @@
 extern tset_hash_t test_set_hash[TEST_SET_HASH_BUCKETS];
 
 
-#define HIST  void*
+HIST
+HIST_new(void){
+  HIST h;
+  h = (HIST) malloc(sizeof(struct histogram_struct));
+  if (h) {
+    HIST_clear(h);
+  }
+  return h;
+}
 
-#include "nettest_bsd.h"
+void
+HIST_clear(HIST h){
+  int i;
+  for(i = 0; i < 10; i++){
+#ifdef HAVE_GETHRTIME
+    h->hundred_nsec[i] = 0;
+#endif
+    h->unit_usec[i] = 0;
+    h->ten_usec[i] = 0;
+    h->hundred_usec[i] = 0;
+    h->unit_msec[i] = 0;
+    h->ten_msec[i] = 0;
+    h->hundred_msec[i] = 0;
+    h->unit_sec[i] = 0;
+    h->ten_sec[i] = 0;
+  }
+  h->ridiculous = 0;
+  h->total = 0;
+}
 
+#ifdef HAVE_GETHRTIME
+
+void
+HIST_add_nano(register HIST h, hrtime_t *begin, hrtime_t *end)
+{
+  register int64_t val;
+
+  val = (*end) - (*begin);
+  h->total++;
+  val = val/100;
+  if (val <= 9) h->hundred_nsec[val]++;
+  else {
+    val = val/10;
+    if (val <= 9) h->unit_usec[val]++;
+    else {
+      val = val/10;
+      if (val <= 9) h->ten_usec[val]++;
+      else {
+        val = val/10;
+        if (val <= 9) h->hundred_usec[val]++;
+        else {
+          val = val/10;
+          if (val <= 9) h->unit_msec[val]++;
+          else {
+            val = val/10;
+            if (val <= 9) h->ten_msec[val]++;
+            else {
+              val = val/10;
+              if (val <= 9) h->hundred_msec[val]++;
+              else {
+                val = val/10;
+                if (val <= 9) h->unit_sec[val]++;
+                else {
+                  val = val/10;
+                  if (val <= 9) h->ten_sec[val]++;
+                  else h->ridiculous++;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+#endif
+
+
+void
+HIST_add(register HIST h, int time_delta)
+{
+  register int val;
+  h->total++;
+  val = time_delta;
+  if(val <= 9) h->unit_usec[val]++;
+  else {
+    val = val/10;
+    if(val <= 9) h->ten_usec[val]++;
+    else {
+      val = val/10;
+      if(val <= 9) h->hundred_usec[val]++;
+      else {
+        val = val/10;
+        if(val <= 9) h->unit_msec[val]++;
+        else {
+          val = val/10;
+          if(val <= 9) h->ten_msec[val]++;
+          else {
+            val = val/10;
+            if(val <= 9) h->hundred_msec[val]++;
+            else {
+              val = val/10;
+              if(val <= 9) h->unit_sec[val]++;
+              else {
+                val = val/10;
+                if(val <= 9) h->ten_sec[val]++;
+                else h->ridiculous++;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+
+static xmlAttrPtr
+set_hist_attribute(xmlNodePtr hist, char *name, uint64_t *row)
+{
+  int         i,j;
+  xmlAttrPtr  ap   = NULL;
+  char        values[256];
+  
+  values[0] = 0;
+  for (i = 0, j = 0; i < 10; i++) {
+    j += snprintf(&(values[j]), 256-j, ":%5lld", row[i]);
+  }
+  ap = xmlSetProp(hist, (xmlChar *)name, (xmlChar *)values);
+  return(ap);
+}
+
+
+xmlNodePtr
+HIST_stats_node(HIST h, char *name)
+{
+  int         i,j;
+  xmlNodePtr  hist;
+  xmlAttrPtr  ap;
+  char        value_str[32];
+  
+
+  if ((hist = xmlNewNode(NULL,(xmlChar *)"hist_stats")) != NULL) {
+    ap = xmlSetProp(hist, (xmlChar *)"hist_name", (xmlChar *)name);
+#ifdef HAVE_GETHRTIME
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "hundred_nsec", h->hundred_nsec);
+    }
+#endif
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "unit_usec", h->unit_usec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "ten_usec", h->ten_usec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "hundred_usec", h->hundred_usec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "unit_msec", h->unit_msec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "ten_msec", h->ten_msec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "hundred_msec", h->hundred_msec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "unit_sec", h->unit_sec);
+    }
+    if (ap != NULL) {
+      ap = set_hist_attribute(hist, "ten_sec", h->ten_sec);
+    }
+    if (ap != NULL) {
+      sprintf(value_str,": %4lld",h->ridiculous);
+      ap = xmlSetProp(hist, (xmlChar *)"plus_100_sec", (xmlChar *)value_str);
+    }
+    if (ap != NULL) {
+      sprintf(value_str,": %4lld",h->total);
+      ap = xmlSetProp(hist, (xmlChar *)"hist_total", (xmlChar *)value_str);
+    }
+    if (ap == NULL) {
+      xmlFreeNode(hist);
+      hist = NULL;
+    }
+  }
+  return(hist);
+}
+
+
+void
+HIST_report(FILE *fd, xmlNodePtr hist)
+{
+   int         i;
+   xmlChar    *string;
+   
+   string = xmlGetProp(hist, (const xmlChar *)"hist_name");
+   fprintf(fd, "\nHISTOGRAM REPORT for %s\n", string);
+   fprintf(fd, "              ");
+   for (i=0; i<10; i++) {
+     fprintf(fd, ":%5d",i);
+   }
+   fprintf(fd, "\n");
+   fprintf(fd, "--------------");
+   for (i=0; i<10; i++) {
+     fprintf(fd, "+-----");
+   }
+   fprintf(fd, "\n");
+   string = xmlGetProp(hist, (const xmlChar *)"hundred_nsec");
+   if (string) {
+     fprintf(fd, "HUNDRED_NSEC  %s\n", string);
+   }
+   string = xmlGetProp(hist, (const xmlChar *)"unit_usec");
+   fprintf(fd, "UNIT_USEC     %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"ten_usec");
+   fprintf(fd, "TEN_USEC      %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"hundred_usec");
+   fprintf(fd, "HUNDRED_USEC  %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"unit_msec");
+   fprintf(fd, "UNIT_MSEC     %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"ten_msec");
+   fprintf(fd, "TEN_MSEC      %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"hundred_msec");
+   fprintf(fd, "HUNDRED_MSEC  %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"unit_sec");
+   fprintf(fd, "UNIT_SEC      %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"ten_sec");
+   fprintf(fd, "TEN_SEC       %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"plus_100_sec");
+   fprintf(fd, "100_PLUS_SEC  %s\n", string);
+   string = xmlGetProp(hist, (const xmlChar *)"hist_total");
+   fprintf(fd, "HIST_TOTAL    %s\n", string);
+   fprintf(fd, "\n");
+   fflush(fd);
+}
+
+
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 #endif
@@ -300,6 +534,14 @@
   *timestamp = gethrtime();
 }
 
+uint64_t
+delta_nano(hrtime_t *begin, hrtime_t *end)
+{
+  int64_t nsecs;
+  nsecs = (*end) - (*begin);
+  return(nsecs);
+}
+
 int
 delta_micro(hrtime_t *begin, hrtime_t *end)
 {
@@ -533,7 +775,6 @@
 void
 report_test_status(test_t *test)
 {
-
   char        current[8];
   char        requested[8];
   char        reported[8];

Modified: branches/glib_migration/src/netlib_hpux.c
===================================================================
--- branches/glib_migration/src/netlib_hpux.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/netlib_hpux.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -68,19 +68,19 @@
              PTHREAD_BIND_FORCED_NP,
              &spu,
              value,
-             test->tid);
+             test->thread_id);
   }
   else if (strcmp(loc_type,"LDOM") == 0) {
     err  = pthread_ldom_bind_np(
              &ldom,
              value,
-             test->tid);
+             test->thread_id);
   }
   else if (strcmp(loc_type,"PSET") == 0) {
     err  = pthread_pset_bind_np(
              &pset,
              value,
-             test->tid);
+             test->thread_id);
   }
   if (err) {
     if (err == EINVAL) {

Modified: branches/glib_migration/src/netperf.h
===================================================================
--- branches/glib_migration/src/netperf.h	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/netperf.h	2006-03-28 23:18:08 UTC (rev 107)
@@ -106,11 +106,7 @@
 #error Netperf4 requires either glib or pthreads
 #endif
 
-#ifdef WANT_HISTOGRAM
 #include "netperf_hist.h"
-#else
-#define HIST  void*
-#endif
 
 #ifdef WIN32
 #define NETPERF_DEBUG_LOG_DIR "c:\\temp\\"

Modified: branches/glib_migration/src/netperf_docs.dtd
===================================================================
--- branches/glib_migration/src/netperf_docs.dtd	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/netperf_docs.dtd	2006-03-28 23:18:08 UTC (rev 107)
@@ -9,22 +9,25 @@
 
 <!-- default entity definitions these may be changed as desired -->
 
-<!ENTITY % default.family	'"AF_INET"' >
-<!ENTITY % default.host		'"localhost"' >
-<!ENTITY % default.npservice	'"netperf4"' >
-<!ENTITY % default.tstservice	'"0"' >
-<!ENTITY % default.socksize	'"32"' >
-<!ENTITY % default.msgsize     	'"4"' >
-<!ENTITY % default.units     	'"KB"' >
-<!ENTITY % default.reqsize     	'"1"' >
-<!ENTITY % default.rspsize     	'"1"' >
-<!ENTITY % default.width     	'"0"' >
-<!ENTITY % default.align     	'"8"' >
-<!ENTITY % default.offset     	'"0"' >
-<!ENTITY % default.no_delay    	'"0"' >
+<!ENTITY % default.family                  '"AF_INET"' >
+<!ENTITY % default.host                    '"localhost"' >
+<!ENTITY % default.npservice               '"netperf4"' >
+<!ENTITY % default.tstservice              '"0"' >
+<!ENTITY % default.socksize                '"32"' >
+<!ENTITY % default.msgsize                 '"4"' >
+<!ENTITY % default.units                   '"KB"' >
+<!ENTITY % default.reqsize                 '"1"' >
+<!ENTITY % default.rspsize                 '"1"' >
+<!ENTITY % default.width                   '"0"' >
+<!ENTITY % default.align                   '"8"' >
+<!ENTITY % default.offset                  '"0"' >
+<!ENTITY % default.no_delay                '"0"' >
+<!ENTITY % default.disk_io_size            '"8"' >
+<!ENTITY % default.disk_io_units           '"KB"' >
+<!ENTITY % default.disk_test_size          '"4"' >
+<!ENTITY % default.disk_test_units         '"MB"' >
 
 
-     
 <!-- Changeing the definition of any configuration file entity or element
      below this comment may require a code change.  sgb 2003-10-11 -->
 
@@ -162,8 +165,8 @@
   port		CDATA	#REQUIRED
 >
 
-<!ELEMENT test ((dependson | dependency_data)?, (socket_args | unknown )?,
-                 (dns_args)? ) >
+<!ELEMENT test ((dependson | dependency_data)?,
+                ((socket_args , (dns_args)?) | disk_args | unknown )? ) >
 <!ATTLIST test
   xmlns           CDATA   #FIXED    "http://www.netperf.org/ns/netperf"
   tid             ID      #REQUIRED
@@ -199,6 +202,7 @@
      system specific.  If locality_value is not specified no binding occurs.
      If an invalid locality_value is specified no binding occurs. -->
 
+
 <!ELEMENT unknown (#PCDATA) >
 
 <!ELEMENT version EMPTY >
@@ -328,17 +332,6 @@
   tid           ID      #REQUIRED
 >
 
-<!-- if output_file is not specified output defaults to stdout -->
-<!-- The attributes command_file and output_file are for a looped tests -->
-<!-- The attributes interval and confidence are for checking confidence
-     for reported test results.  min_count must be specified to check
-     confidence. -->
-<!-- Interval is the desired percentage range around the mean for which
-     the confidence level is calculated.   example 0.05 is mean +/- 2.5%
-     The default value for interval is 0.05  -->
-<!-- confidence is the desired confidence level which measured results
-     fall within the interval around the reported measured mean. 
-     The default value for confidence is 99% -->
 
 <!ELEMENT report_stats (
   (clear_stats) |
@@ -364,7 +357,18 @@
   interval      CDATA   #IMPLIED
   confidence  (50 | 70 | 80 | 90 | 95 | 98 | 99 | 99.8 | 99.9) #IMPLIED
 >
+<!-- If attribute output_file is not specified output defaults to stdout -->
+<!-- The attributes interval and confidence are for checking confidence
+     for reported test results.  min_count must be specified and must be
+     >1 to check confidence. -->
+<!-- Interval is the desired percentage range around the mean for which
+     the confidence level is calculated.   example 0.05 is mean +/- 2.5%
+     The default value for interval is 0.05  -->
+<!-- confidence is the desired confidence level which measured results
+     fall within the interval around the reported measured mean. 
+     The default value for confidence is 99% -->
 
+
 <!ELEMENT snap EMPTY >
 <!ATTLIST snap tid  IDREF  "t_all" >
 
@@ -402,7 +406,8 @@
   other_count    CDATA   #IMPLIED
 >
 
-<!ELEMENT test_stats ( #PCDATA ) >
+
+<!ELEMENT test_stats ( #PCDATA | hist_stats)* >
 <!ATTLIST test_stats 
   tid            ID      #REQUIRED
   elapsed_sec    CDATA   #IMPLIED
@@ -443,6 +448,22 @@
   infoF_value    CDATA   #IMPLIED
 >
 
+<!ELEMENT hist_stats EMPTY >
+<!ATTLIST hist_stats
+  hist_name      CDATA   #REQUIRED
+  hundred_nsec   CDATA   #REQUIRED
+  unit_usec      CDATA   #REQUIRED
+  ten_usec       CDATA   #REQUIRED
+  hundred_usec   CDATA   #REQUIRED
+  unit_msec      CDATA   #REQUIRED
+  ten_msec       CDATA   #REQUIRED
+  hundred_msec   CDATA   #REQUIRED
+  unit_sec       CDATA   #REQUIRED
+  ten_sec        CDATA   #REQUIRED
+  plus_100_sec   CDATA   #REQUIRED
+  hist_total     CDATA   #REQUIRED
+>
+  
 
 <!ELEMENT socket_args EMPTY >
 <!ATTLIST socket_args
@@ -471,12 +492,65 @@
   recv_offset       CDATA    %default.offset;
 >
 
+
 <!ELEMENT dns_args EMPTY >
 <!ATTLIST dns_args
   max_outstanding   CDATA    #IMPLIED
   timeout           CDATA    #IMPLIED
 >
                       
+
+<!-- Element definitions for Disk Tests -->
+
+<!ELEMENT disk_args EMPTY >
+<!ATTLIST disk_args
+  file_name         CDATA    #REQUIRED
+  read              CDATA    #IMPLIED
+  disk_io_size      CDATA                 %default.disk_io_size;
+  disk_io_units     ( KB | MB | GB)       %default.disk_io_units;
+  disk_test_size    CDATA                 %default.disk_test_size;
+  disk_test_units   ( KB | MB | GB)       %default.disk_test_units;
+  start             CDATA    #IMPLIED
+  stop              CDATA    #IMPLIED
+  scsi_immreport    (0 | 1)  #IMPLIED
+  scsi_queue_depth  CDATA    #IMPLIED
+>
+
+<!-- read
+     Specifies the ratio of reads to all I/Os.  Valid values 1.0 to 0.0.
+     For sequential I/O tests any non-zero value defaults to read only.
+     Default value is 1.0 when no value is specified. -->
+<!-- disk_io_size
+     The size in disk_io_units of each read/write to the file.
+     Must have at maximum value of disk test size in bytes / 2.
+     Default value is smaller of 8K or disk test size in bytes / 2
+     when no value is specified.  DTD specifies default of 8KB. -->
+<!-- disk_io_units
+     Default value of 1024 bytes. -->
+<!-- disk_test_size
+     The size in disk_test_units of the file to access.
+     Default value is smaller of 512*chunk or max_file_size-start_position
+     when no value is specified. DTD specifies default of 4MB. -->
+<!-- disk_test_units
+     Default value of 1024 * 1024 bytes. -->
+<!-- start_position
+     KByte offset within the file at which to start I/O.
+     Raw I/O will be rounded to a sector boundary if sector size > 1KB.
+     Default value is 0 when no value is specified. -->
+<!-- end_position
+     Maximum KByte offset within the file.
+     Will always be defaulted for sequential I/O tests.
+     Default value when no value is specified is
+     start_position + (size converted to KB)
+     or maximum_file_size which ever is smaller. -->
+<!-- scsi_immreport
+     Specifies the value to which scsi_immreport will be set.
+     If not specified the test will not change the current value. -->
+<!-- scsi_queue_depth
+     Specifies the value to which scsi_queue_depth will be set.
+     If not specified the test will not change the current value. -->
+
+
 <!-- Element definitions for variable sized data tests  -->
 
 <!ELEMENT work_load_description (pattern, distribution?)* >

Modified: branches/glib_migration/src/netperf_hist.h
===================================================================
--- branches/glib_migration/src/netperf_hist.h	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/netperf_hist.h	2006-03-28 23:18:08 UTC (rev 107)
@@ -31,6 +31,7 @@
 
 */
 
+
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
@@ -41,12 +42,53 @@
 #  include <time.h>
 # endif
 #endif
+#ifdef IRIX
+#include <sys/time.h>
+#endif /* IRIX */
 
+#if !defined(NETLIB) && !defined(WANT_HISTOGRAM)
+
+#define HISTOGRAM_VARS       /* variable declarations for histogram go here */
+#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
+#define HIST_ADD(h,t1,t2)    /* call to add data to histogram goes here */
+#define HIST_CLEAR(h)        /* call to clear histogram data goes here */
+#define HIST_STATS_NODE(h,n) /* call to get hist statistics node goes here */
+#define HIST_REPORT(fd,h)    /* call to report histogram data goes here */
+
+#define HIST_NEW()           NULL
+
+#define HIST   void*
+
+#else
+
+#ifdef WANT_HISTOGRAM
+
+#ifdef HAVE_GETHRTIME
+#define HISTOGRAM_VARS        hrtime_t time_one,time_two
+#define HIST_ADD(h,t1,t2)     HIST_add_nano(h,t1,t2)
+#else
+#define HISTOGRAM_VARS        struct timeval time_one,time_two
+#define HIST_ADD(h,t1,t2)     HIST_add(h,delta_micro(t1,t2))
+#endif
+
+#define HIST_CLEAR(h)         HIST_clear(h)
+#define HIST_TIMESTAMP(time)  netperf_timestamp(time)
+#define HIST_NEW()            HIST_new()
+#define HIST_STATS_NODE(h,n)  HIST_stats_node(h,n)
+#define HIST_REPORT(fd,h)     HIST_report(fd,h)
+
+typedef void *HIST;
+
+#endif
+
+#ifdef NETLIB
+
 /* hist.h
 
-   Given a time difference in microseconds, increment one of 81
+   Given a time difference in microseconds, increment one of 91
    different buckets: 
    
+   0 - 9 in increments of 100 nsecs
    0 - 9 in increments of 1 usec
    0 - 9 in increments of 10 usecs
    0 - 9 in increments of 100 usecs
@@ -64,63 +106,76 @@
    
    Colin Low  10/6/93
    Rick Jones 2004-06-15 - extend to 1 and 10 usec
+   Stephen Burger 2006-03-17 - extend to 100 nsec
 */
-#ifndef _HIST_INCLUDED
-#define _HIST_INCLUDED
 
-#ifdef IRIX
-#include <sys/time.h>
-#endif /* IRIX */
-   
 struct histogram_struct {
-  int unit_usec[10];
-  int ten_usec[10];
-  int hundred_usec[10];
-  int unit_msec[10];
-  int ten_msec[10];
-  int hundred_msec[10];
-  int unit_sec[10];
-  int ten_sec[10];
-  int ridiculous;
-  int total;
+  uint64_t   hundred_nsec[10];
+  uint64_t   unit_usec[10];
+  uint64_t   ten_usec[10];
+  uint64_t   hundred_usec[10];
+  uint64_t   unit_msec[10];
+  uint64_t   ten_msec[10];
+  uint64_t   hundred_msec[10];
+  uint64_t   unit_sec[10];
+  uint64_t   ten_sec[10];
+  uint64_t   ridiculous;
+  uint64_t   total;
 };
 
 typedef struct histogram_struct *HIST;
 
+#endif
+
+#ifndef _HIST_INCLUDED
+#define _HIST_INCLUDED
+   
 /* 
    HIST_new - return a new, cleared histogram data type
 */
 
-HIST HIST_new(void); 
+extern HIST HIST_new(void); 
 
 /* 
    HIST_clear - reset a histogram by clearing all totals to zero
 */
 
-void HIST_clear(HIST h);
+extern void HIST_clear(HIST h);
 
 /*
    HIST_add - add a time difference to a histogram. Time should be in
    microseconds. 
 */
 
-void HIST_add(register HIST h, int time_delta);
+#ifdef HAVE_GETHRTIME
+extern void HIST_add_nano(register HIST h, hrtime_t *begin, hrtime_t *end);
+#else
+extern void HIST_add(register HIST h, int time_delta);
+#endif
 
 /* 
+  HIST_stats_node - create a histogram statistics xml node to report 
+  on the contents of a histogram. Second parameter is a descriptive
+  name to be reported with the histogram.
+*/
+
+extern xmlNodePtr HIST_stats_node(HIST h, char *name);
+
+/* 
   HIST_report - create an ASCII report on the contents of a histogram.
-  Currently printsto standard out 
+  prints to file fd the histogram statistics in the xml node.
 */
 
-void HIST_report(HIST h);
+extern void HIST_report(FILE *fd, xmlNodePtr h);
 
 /*
-  HIST_timestamp - take a timestamp suitable for use in a histogram.
+  netperf_timestamp - take a timestamp suitable for use in a histogram.
 */
 
 #ifdef HAVE_GETHRTIME
-void HIST_timestamp(hrtime_t *timestamp);
+extern void netperf_timestamp(hrtime_t *timestamp);
 #else
-void HIST_timestamp(struct timeval *timestamp);
+extern void netperf_timestamp(struct timeval *timestamp);
 #endif
 
 /*
@@ -132,12 +187,14 @@
   limited to WANT_HISTOGRAM?  raj 2005-12-09
 */
 #ifdef HAVE_GETHRTIME
-int delta_micro(hrtime_t *begin, hrtime_t *end);
-int delta_milli(hrtime_t *begin, hrtime_t *end);
+extern int delta_micro(hrtime_t *begin, hrtime_t *end);
+extern int delta_milli(hrtime_t *begin, hrtime_t *end);
 #else
-int delta_micro(struct timeval *begin, struct timeval *end);
-int delta_milli(struct timeval *begin, struct timeval *end);
+extern int delta_micro(struct timeval *begin, struct timeval *end);
+extern int delta_milli(struct timeval *begin, struct timeval *end);
 #endif
 
 #endif
 
+#endif
+

Modified: branches/glib_migration/src/nettest_bsd.c
===================================================================
--- branches/glib_migration/src/nettest_bsd.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/nettest_bsd.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -42,15 +42,6 @@
 #define MAKE_DIRTY(mydata,ring)  /* DIRTY is not currently supported */
 #endif
 
-#ifdef HISTOGRAM
-#define HISTOGRAM_VARS        struct timeval time_one,time_two
-#define HIST_TIMESTAMP(time)  gettimeofday(time,NULL)
-#define HIST_ADD(h,delta)     HIST_add(h,delta)
-#else
-#define HISTOGRAM_VARS       /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,delta)    /* call to add data to histogram goes here */
-#endif
 
 /****************************************************************/
 /*                                                              */
@@ -1322,7 +1313,7 @@
   }
   /* code to timestamp enabled by WANT_HISTOGRAM */
   HIST_TIMESTAMP(&time_two);
-  HIST_ADD(my_data->time_hist,delta_micro(&time_one,&time_two));
+  HIST_ADD(my_data->time_hist,&time_one,&time_two);
   new_state = CHECK_REQ_STATE;
   if (new_state == TEST_LOADED) {
     /* transitioning to loaded state from measure state
@@ -1507,7 +1498,7 @@
   my_data->send_ring = my_data->send_ring->next;
   /* code to timestamp enabled by WANT_HISTOGRAM */
   HIST_TIMESTAMP(&time_two);
-  HIST_ADD(my_data->time_hist,delta_micro(&time_one,&time_two));
+  HIST_ADD(my_data->time_hist,&time_one,&time_two);
   new_state = CHECK_REQ_STATE;
   if (new_state == TEST_LOADED) {
     /* transitioning to loaded state from measure state
@@ -1923,7 +1914,7 @@
   }
   /* code to timestamp enabled by WANT_HISTOGRAM */
   HIST_TIMESTAMP(&time_two);
-  HIST_ADD(my_data->time_hist,delta_micro(&time_one,&time_two));
+  HIST_ADD(my_data->time_hist,&time_one,&time_two);
   my_data->recv_ring = my_data->recv_ring->next;
   my_data->send_ring = my_data->send_ring->next;
   new_state = CHECK_REQ_STATE;
@@ -2174,7 +2165,7 @@
   }
   /* code to timestamp enabled by WANT_HISTOGRAM */
   HIST_TIMESTAMP(&time_two);
-  HIST_ADD(my_data->time_hist,delta_micro(&time_one,&time_two));
+  HIST_ADD(my_data->time_hist,&time_one,&time_two);
   my_data->stats.named.trans_sent++;
   my_data->recv_ring = my_data->recv_ring->next;
   my_data->send_ring = my_data->send_ring->next;

Modified: branches/glib_migration/src/nettest_dns.c
===================================================================
--- branches/glib_migration/src/nettest_dns.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/nettest_dns.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -35,15 +35,6 @@
 #include "config.h"
 #endif
 
-#ifdef HISTOGRAM
-#define HISTOGRAM_VARS        struct timeval time_one,time_two
-#define HIST_TIMESTAMP(time)  gettimeofday(time,NULL)
-#define HIST_ADD(h,delta)     HIST_add(h,delta)
-#else
-#define HISTOGRAM_VARS       /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,delta)    /* call to add data to histogram goes here */
-#endif
 
 /****************************************************************/
 /*                                                              */
@@ -1524,8 +1515,7 @@
 	/* this is what we want to see */
 	/* code to timestamp enabled by WANT_HISTOGRAM */
 	HIST_TIMESTAMP(&time_two);
-	HIST_ADD(my_data->time_hist,
-		 delta_milli(&(status_entry->sent_time),&time_two));
+	HIST_ADD(my_data->time_hist, &(status_entry->sent_time), &time_two);
 	/* my_data->stats.named.responses_received++; */
 	/* so we can continue to "leverage" the nettest_bsd reporter for
 	   now. raj 2005-11-18 */

Modified: branches/glib_migration/src/nettest_vst.c
===================================================================
--- branches/glib_migration/src/nettest_vst.c	2006-03-28 04:29:06 UTC (rev 106)
+++ branches/glib_migration/src/nettest_vst.c	2006-03-28 23:18:08 UTC (rev 107)
@@ -18,16 +18,8 @@
 #define MAKE_DIRTY(mydata,ring)  /* DIRTY is not currently supported */
 #endif
 
-#ifdef WANT_HISTOGRAM
-#define HISTOGRAM_VARS        struct timeval time_one,time_two
-#define HIST_TIMESTAMP(time)  gettimeofday(time,NULL)
-#define HIST_ADD(h,delta)     HIST_add(h,delta)
-#else
-#define HISTOGRAM_VARS       /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,delta)    /* call to add data to histogram goes here */
-#endif
 
+
 /****************************************************************/
 /*                                                              */
 /*      nettest_vst.c                                           */
@@ -1774,7 +1766,7 @@
     }
     /* code to timestamp enabled by WANT_HISTOGRAM */
     HIST_TIMESTAMP(&time_two);
-    HIST_ADD(my_data->time_hist,delta_macro(&time_one,&time_two));
+    HIST_ADD(my_data->time_hist,&time_one,&time_two);
     get_next_vst_transaction(test);
   }
   new_state = CHECK_REQ_STATE;
@@ -2073,7 +2065,7 @@
     }
     /* code to timestamp enabled by WANT_HISTOGRAM */
     HIST_TIMESTAMP(&time_two);
-    HIST_ADD(my_data->time_hist,delta_macro(&time_one,&time_two));
+    HIST_ADD(my_data->time_hist,&time_one,&time_two);
     my_data->stats.named.trans_sent++;
     get_next_vst_transaction(test);
     if (len == 0) {



More information about the netperf-dev mailing list