[netperf-dev] netperf2 commit notice r174 - trunk/src

raj at netperf.org raj at netperf.org
Tue Jan 22 18:02:25 PST 2008


Author: raj
Date: 2008-01-22 18:02:24 -0800 (Tue, 22 Jan 2008)
New Revision: 174

Modified:
   trunk/src/netlib.c
   trunk/src/netlib.h
   trunk/src/nettest_bsd.h
   trunk/src/nettest_omni.c
Log:
start working on omni output

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2008-01-22 22:31:03 UTC (rev 173)
+++ trunk/src/netlib.c	2008-01-23 02:02:24 UTC (rev 174)
@@ -4150,6 +4150,24 @@
   *remote_service_demand   = (float)measured_mean_remote_service_demand;
 }
 
+float
+get_result_confid()
+{
+  return 100.0 * (interval - result_confid);
+}
+
+float
+get_loc_cpu_confid()
+{
+  return 100.0 * (interval - loc_cpu_confid);
+}
+
+float
+get_rem_cpu_confid()
+{
+  return 100.0 * (interval - rem_cpu_confid);
+}
+
  /* display_confidence() is called when we could not achieve the */
  /* desirec confidence in the results. it will print the achieved */
  /* confidence to "where" raj 11/94 */

Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h	2008-01-22 22:31:03 UTC (rev 173)
+++ trunk/src/netlib.h	2008-01-23 02:02:24 UTC (rev 174)
@@ -488,6 +488,9 @@
 			  float *remote_cpu_utilization,
 			  float *local_service_demand,
 			  float *remote_service_demand);
+extern  float   get_result_confid();
+extern  float   get_loc_cpu_confid();
+extern  float   get_rem_cpu_confid();
 extern  void    display_confidence();
 extern  void    get_sock_buffer(SOCKET sd,
 				enum sock_buffer which,

Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h	2008-01-22 22:31:03 UTC (rev 173)
+++ trunk/src/nettest_bsd.h	2008-01-23 02:02:24 UTC (rev 174)
@@ -30,14 +30,14 @@
   uint32_t   send_alignment;        /* alignment of send buffer */
   uint32_t   send_offset;           /* offset from send alignment */
   uint32_t   send_width;            /* number of send buffers to use */
-  int32_t   request_size;          /* size of a request */
+  int32_t    request_size;          /* size of a request */
 
   int32_t    recv_buf_size;         /* SO_RCVBUF */
   uint32_t   receive_size;          /* size of buffers in recv */
   uint32_t   recv_alignment;        /* alignment of recv buffer */
   uint32_t   recv_offset;           /* offset from recv alignment */
   uint32_t   recv_width;            /* number of recv buffers to use */
-  int32_t   response_size;         /* size of a response */
+  int32_t    response_size;         /* size of a response */
 
   uint32_t   no_delay;              /* do we set mumble_NODELAY? */
   uint32_t   use_sendfile;          /* use sendfile rather than send? */
@@ -93,7 +93,7 @@
   double     bytes_sent;
   uint32_t   send_calls;
   int32_t    send_buf_size; /* SO_SNDBUF at end of test */
-
+  uint32_t   failed_sends;
   uint32_t   trans_received; 
 
   float      elapsed_time;  /* length of test in seconds */

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2008-01-22 22:31:03 UTC (rev 173)
+++ trunk/src/nettest_omni.c	2008-01-23 02:02:24 UTC (rev 174)
@@ -148,9 +148,9 @@
 int bytes_to_recv;
 int bytes_per_recv;
 int null_message_ok = 0;
-uint64_t	trans_completed;
-uint64_t	units_remaining;
-uint64_t	bytes_sent;
+uint64_t      trans_completed;
+uint64_t      units_remaining;
+uint64_t      bytes_sent;
 uint64_t      bytes_received;
 uint64_t      local_send_calls;
 uint64_t      local_receive_calls;
@@ -158,6 +158,13 @@
 uint64_t      remote_bytes_received;
 uint64_t      remote_send_calls;
 uint64_t      remote_receive_calls;
+  double      bytes_xferd;
+  double      remote_bytes_xferd;
+  float       elapsed_time;
+  float	      local_cpu_utilization;
+  float	      local_service_demand;
+  float	      remote_cpu_utilization;
+  float	      remote_service_demand;
 
 int sd_kb = 1;  /* is the service demand per KB or per tran? */
 
@@ -193,6 +200,24 @@
   local_connected,
   remote_connected;
 
+enum netperf_output_name {
+  LSS_SIZE,
+  LSR_SIZE,
+  NETPERF_OUTPUT_MAX
+};
+
+typedef struct netperf_output_elt {
+  int output_name;  /* belt and suspenders */
+  int max_line_len; /* length of the longest of the "lines" */
+  int tot_line_len; /* total length of all lines, including spaces */
+  char *line1;
+  char *line2;
+  char *line3;
+  char *line4;
+  char *format;         /* format to apply to value */
+  void *display_value;  /* where to find the value */
+} neperf_output_elt_t;
+
 static unsigned short
 get_port_number(struct addrinfo *res) 
 {
@@ -293,6 +318,70 @@
   set_port_number(local_res, (unsigned short)myport);
 }
 
+void
+print_omni_csv()
+{
+
+}
+
+void
+print_omni_human()
+{
+
+  /* this is mostly just place holding while other things are worked-out */
+  printf("socket type %d protocol %d direction %d\n",
+	 socket_type,
+	 protocol,
+	 direction);
+
+  printf("bytes xfered %g  remote %g trans %lld elapsed %g\n",
+	 bytes_xferd,
+	 remote_bytes_xferd,
+	 trans_completed,
+	 elapsed_time);
+  
+  printf("lss_size_req %d lsr_size_req %d rss_size_req %d rsr_size_req %d\n",
+	 lss_size_req,
+	 lsr_size_req,
+	   rss_size_req,
+	 rsr_size_req);
+  
+  printf("lss_size %d lsr_size %d rss_size %d rsr_size %d\n",
+	 lss_size,
+	 lsr_size,
+	 rss_size,
+	 rsr_size);
+  
+  printf("lss_size_end %d lsr_size_end %d rss_size_end %d rsr_size_end %d\n",
+	 lss_size_end,
+	 lsr_size_end,
+	 rss_size_end,
+	 rsr_size_end);
+  
+  printf("loc_cpu %3.2f rem_cpu %3.2f\n",
+	 local_cpu_utilization,
+	 remote_cpu_utilization);
+
+  if (iteration_max > 1) {
+    printf("result_confid %4.3f loc_cpu_confid %4.3f rem_cpu_confid %4.3f\n",
+	   get_result_confid(),
+	   get_loc_cpu_confid(),
+	   get_rem_cpu_confid());
+  }
+  else {
+    printf("result_confid %4.3f loc_cpu_confid %4.3f rem_cpu_confid %4.3f\n",
+	   -1.0,
+	   -1.0,
+	   -1.0);
+  }
+	   
+}
+
+void
+print_omni()
+{
+
+}
 /* for the next few routines (connect, accept, send, recv,
    disconnect/close) we will use a return of -1 to mean times up, -2
    to mean a transient error (eg ENOBUFS on a UDP send call) and -3 to
@@ -613,7 +702,6 @@
 send_omni(char remote_host[])
 {
   
-  float			elapsed_time;
   
   int len;
   int ret;
@@ -632,15 +720,8 @@
   SOCKET	data_socket;
   int           need_socket;
 
-  double	bytes_xferd;
-  double        remote_bytes_xferd;
-
   int   temp_recvs;
 
-  float	        local_cpu_utilization;
-  float	        local_service_demand;
-  float	        remote_cpu_utilization;
-  float	        remote_service_demand;
   double	thruput;
   
   struct addrinfo *local_res;
@@ -1300,31 +1381,6 @@
     remote_bytes_xferd = omni_result->bytes_received +
       omni_result->bytes_sent;
   
-    printf("bytes xfered %g  remote %g trans %d elapsed %g\n",
-	   bytes_xferd,
-	   remote_bytes_xferd,
-	   omni_result->trans_received,
-	   elapsed_time);
-
-    printf("lss_size_req %d lsr_size_req %d rss_size_req %d rsr_size_req %d\n",
-	   lss_size_req,
-	   lsr_size_req,
-	   rss_size_req,
-	   rsr_size_req);
-
-    printf("lss_size %d lsr_size %d rss_size %d rsr_size %d\n",
-	   lss_size,
-	   lsr_size,
-	   rss_size,
-	   rsr_size);
-
-    printf("lss_size_end %d lsr_size_end %d rss_size_end %d rsr_size_end %d\n",
-	   lss_size_end,
-	   lsr_size_end,
-	   rss_size_end,
-	   rsr_size_end);
-
-	   
     /* ok, time to possibly calculate cpu util and/or service demand */
     if (local_cpu_usage) {
       if (local_cpu_rate == 0.0) {
@@ -1397,6 +1453,8 @@
 			    &local_service_demand,
 			    &remote_service_demand);
 
+  print_omni_human();
+
   fprintf(where,
 	  "Confidence was %g after %d iterations\n",
 	  confidence,
@@ -1444,7 +1502,6 @@
   int   connected;
   int   ret;
   int   temp_recvs;
-  float	elapsed_time;
   
   struct	omni_request_struct	*omni_request;
   struct	omni_response_struct	*omni_response;
@@ -1974,7 +2031,7 @@
   omni_results->elapsed_time	= elapsed_time;
 
   if (omni_request->measure_cpu) {
-    omni_results->cpu_util	= calc_cpu_util(elapsed_time);
+
   }
   
   if (debug) {



More information about the netperf-dev mailing list