[netperf-dev] netperf4 commit notice r12 - trunk/src
raj at netperf.org
raj at netperf.org
Thu Nov 10 15:09:14 PST 2005
Author: raj
Date: 2005-11-10 15:09:13 -0800 (Thu, 10 Nov 2005)
New Revision: 12
Modified:
trunk/src/netmsg.c
trunk/src/netserver.c
trunk/src/netsysstats_hpux.c
Log:
Misc cleanups prior to trying to get netserver to loop on accepts
Modified: trunk/src/netmsg.c
===================================================================
--- trunk/src/netmsg.c 2005-10-28 00:43:09 UTC (rev 11)
+++ trunk/src/netmsg.c 2005-11-10 23:09:13 UTC (rev 12)
@@ -137,7 +137,6 @@
if (msg == NULL) {
fprintf(stderr,"empty document\n");
fflush(stderr);
- printf("freeing the %p empty doc\n",doc);
xmlFreeDoc(doc);
/* somehow I don't think that returning NPE_SUCCESS is the right
thing here? raj 2005-10-26 */
@@ -185,9 +184,7 @@
which_msg++;
}
}
- printf("freeing the %p doc doc\n",doc);
xmlFreeDoc(doc);
- printf("freed the %p doc doc\n",doc);
return(rc);
}
Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c 2005-10-28 00:43:09 UTC (rev 11)
+++ trunk/src/netserver.c 2005-11-10 23:09:13 UTC (rev 12)
@@ -164,7 +164,6 @@
int c;
ofile = stdout;
-
while ((c = getopt_long (argc, argv,
"d" /* debug */
"f" /* forground */
@@ -308,10 +307,7 @@
xmlNodePtr cur;
server_t * netperf;
- if (debug) {
- fprintf(where,"instantiate_netperf: entered\n");
- fflush(where);
- }
+ NETPERF_DEBUG_ENTRY(debug,where);
while (rc != NPE_SUCCESS) {
rc = recv_control_message(sock,&message);
@@ -356,7 +352,8 @@
rc = ns_version_check(cur,message,netperf);
}
}
- } else {
+ }
+ else {
if (debug) {
fprintf(where,"instantiate_netperf: close connection remote close\n");
fflush(where);
@@ -425,6 +422,9 @@
int sock;
int rc;
int listenfd = 0;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
/*
if we were given a port number on the command line open a socket.
Otherwise, if fd 0 is a socket then assume netserver was called by
@@ -440,7 +440,7 @@
&peerlen);
if (listenfd == -1) {
- fprintf(where,"netserver_init: failed to open listen socket\n");
+ fprintf(where,"setup_listen_endpoint: failed to open listen socket\n");
fflush(where);
exit(1);
}
@@ -455,26 +455,27 @@
}
if ((sock = accept(listenfd,peeraddr,&peerlen)) == -1) {
- fprintf(where,"netserver_init: accept failed\n");
+ fprintf(where,"setup_listen_endpoint: accept failed\n");
fflush(where);
exit(1);
}
if (debug) {
fprintf(where,
- "netserver_init: accepted connection on sock %d\n",
- sock);
+ "setup_listen_endpoint: accepted connection on sock %d\n",
+ sock);
fflush(where);
}
-
+
rc = instantiate_netperf(sock);
if (rc != NPE_SUCCESS) {
- fprintf(where, "netserver_init: instantiate_netperf error %d\n",rc);
+ fprintf(where, "setup_listen_endpoint: instantiate_netperf error %d\n",rc);
fflush(where);
exit;
}
}
}
+
/* Netserver initialization */
static void
netserver_init()
@@ -489,6 +490,8 @@
int peerlen = namelen;
int peeraddr_len = namelen;
+ NETPERF_DEBUG_ENTRY(debug,where);
+
char *service = NULL;
for (i = 0; i < NETPERF_HASH_BUCKETS; i++) {
@@ -716,7 +719,7 @@
static void
-accopt_netperf_connections()
+accept_netperf_connections()
{
}
@@ -730,6 +733,8 @@
xmlDocPtr message;
server_t *netperf;
+ NETPERF_DEBUG_ENTRY(debug,where);
+
netperf = netperf_hash[0].server;
/* mutex locking is not required because only one
netserver thread looks at these data structures sgb */
@@ -840,7 +845,10 @@
/* I wonder if this should be in handle_netperf_requests? */
rc = instantiate_netperf(sock);
if (rc != NPE_SUCCESS) {
- fprintf(where, "netserver_init: instantiate_netperf error %d\n",rc);
+ fprintf(where,
+ "%s main: instantiate_netperf error %d\n",
+ program_name,
+ rc);
fflush(where);
exit;
}
Modified: trunk/src/netsysstats_hpux.c
===================================================================
--- trunk/src/netsysstats_hpux.c 2005-10-28 00:43:09 UTC (rev 11)
+++ trunk/src/netsysstats_hpux.c 2005-11-10 23:09:13 UTC (rev 12)
@@ -93,16 +93,16 @@
void
get_cpu_time_counters(cpu_time_counters_t *res,
struct timeval *time,
- test_t *test);
+ test_t *test)
{
+ netsysstat_data_t *tsd = GET_TEST_DATA(test);
struct pst_processor *psp = tsd->psd;
int num_cpus = tsd->num_cpus;
int i;
double ticks;
double iticksperclktick;
double elapsed;
- netsysstat_data_t *tsd = GET_TEST_DATA(test);
/* get the idle cycle counter for each processor. now while on a
64-bit kernel the ".psc_hi" and ".psc_lo" fields are 64 bits,
More information about the netperf-dev
mailing list