[netperf-dev] netperf4 commit notice r96 - trunk/src

burger at netperf.org burger at netperf.org
Fri Mar 24 11:37:51 PST 2006


Author: burger
Date: 2006-03-24 11:37:49 -0800 (Fri, 24 Mar 2006)
New Revision: 96

Modified:
   trunk/src/disktest.c
   trunk/src/disktest.h
   trunk/src/dsk_commands.xml
   trunk/src/dsk_config.xml
   trunk/src/netlib.c
   trunk/src/netperf_hist.h
Log:
Increased size of histogram counters to 64 bits.
Fixed some formating problems in reporting routines for disktest.
Fixed problem with some disk sizes causing errors.
disktest now requires the file offsets are 64 bits
_FILE_OFFSET_BITS is set to 64 at begining of disktest.c

Stephen Burger



Modified: trunk/src/disktest.c
===================================================================
--- trunk/src/disktest.c	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/disktest.c	2006-03-24 19:37:49 UTC (rev 96)
@@ -46,6 +46,9 @@
 
 
 
+/* requires 64 bit file offsets */
+#define _FILE_OFFSET_BITS 64
+
 /* turn on histogram capability */
 #define WANT_HISTOGRAM
 
@@ -273,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));
@@ -300,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;
@@ -322,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;
@@ -383,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);
@@ -394,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,
@@ -438,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);
@@ -464,8 +493,8 @@
   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);
@@ -538,15 +567,19 @@
       }
     }
     /* add hist_stats entries to the status report */
-    hist = HIST_stats_node(my_data->read_hist, "DISK READ");
-    if (hist != NULL) {
-      fprintf(test->where, "Adding Histogram child\n");
-      fflush(test->where);
-      xmlAddChild(stats,hist);
+    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);
+      }
     }
-    hist = HIST_stats_node(my_data->write_hist, "DISK WRITE");
-    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);
@@ -570,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);
@@ -597,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,
@@ -624,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);
@@ -638,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__, 
@@ -684,6 +722,7 @@
   struct capacity           scsi_capacity;
   capacity_type             capacity;
   int                       ir_flag;
+  int                       loc_debug = 0;
 
 
   my_data     = GET_TEST_DATA(test);
@@ -906,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) {
@@ -1129,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;
   }
@@ -1166,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
@@ -1223,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",
@@ -1234,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) {
@@ -1251,9 +1293,6 @@
   rd->write_iops[index]      += write_call_rate;
   rd->iops[index]            += iops;
 
-  fprintf(outfd,"%s:print_hist=%d  print_test=%d  print_run=%d\n",
-          __func__, rd->print_hist, rd->print_test, rd->print_run);
-  fflush(outfd);
   if (rd->print_hist) {
     xmlNodePtr  hist;
     hist = stats->xmlChildrenNode;
@@ -1274,12 +1313,13 @@
     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);
   }
@@ -1542,7 +1582,7 @@
   disk_results_t *rd;
   double          confidence;
   double          temp;
-  int             loc_debug = 1;
+  int             loc_debug = 0;
 
   rd        = test_set->report_data;
 
@@ -1577,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));
@@ -1623,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);
 }
 
@@ -1677,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);
@@ -1739,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);
@@ -1787,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: trunk/src/disktest.h
===================================================================
--- trunk/src/disktest.h	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/disktest.h	2006-03-24 19:37:49 UTC (rev 96)
@@ -109,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: trunk/src/dsk_commands.xml
===================================================================
--- trunk/src/dsk_commands.xml	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/dsk_commands.xml	2006-03-24 19:37:49 UTC (rev 96)
@@ -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: trunk/src/dsk_config.xml
===================================================================
--- trunk/src/dsk_config.xml	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/dsk_config.xml	2006-03-24 19:37:49 UTC (rev 96)
@@ -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: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/netlib.c	2006-03-24 19:37:49 UTC (rev 96)
@@ -266,7 +266,7 @@
   
   values[0] = 0;
   for (i = 0, j = 0; i < 10; i++) {
-    j += snprintf(&(values[j]), 256-j, ":%5d", row[i]);
+    j += snprintf(&(values[j]), 256-j, ":%5lld", row[i]);
   }
   ap = xmlSetProp(hist, (xmlChar *)name, (xmlChar *)values);
   return(ap);
@@ -314,7 +314,7 @@
       ap = set_hist_attribute(hist, "ten_sec", h->ten_sec);
     }
     if (ap != NULL) {
-      sprintf(value_str,": %4d",h->ridiculous);
+      sprintf(value_str,": %4lld",h->ridiculous);
       ap = xmlSetProp(hist, (xmlChar *)"plus_100_sec", (xmlChar *)value_str);
     }
     if (ap != NULL) {

Modified: trunk/src/netperf_hist.h
===================================================================
--- trunk/src/netperf_hist.h	2006-03-24 01:58:08 UTC (rev 95)
+++ trunk/src/netperf_hist.h	2006-03-24 19:37:49 UTC (rev 96)
@@ -51,12 +51,13 @@
 #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
 
-typedef void *HIST;
+#define HIST   void*
 
 #else
 
@@ -70,6 +71,7 @@
 #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)
@@ -108,17 +110,17 @@
 */
 
 struct histogram_struct {
-  int      hundred_nsec[10];
-  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;
-  int64_t  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;



More information about the netperf-dev mailing list