[netperf-dev] netperf4 commit notice r38 - trunk/src
raj at netperf.org
raj at netperf.org
Mon Jan 23 14:27:07 PST 2006
Author: raj
Date: 2006-01-23 14:27:04 -0800 (Mon, 23 Jan 2006)
New Revision: 38
Modified:
trunk/src/netconfidence.c
trunk/src/netlib.c
trunk/src/netperf.c
trunk/src/netserver.c
trunk/src/netsysstats_common.c
trunk/src/netsysstats_linux.c
trunk/src/nettest_bsd.c
trunk/src/nettest_dns.c
trunk/src/nettest_vst.c
Log:
Lots of cleanup - missing includes, some bogus format statements etc.
Modified: trunk/src/netconfidence.c
===================================================================
--- trunk/src/netconfidence.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netconfidence.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -43,6 +43,10 @@
#include <math.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
#include "netperf.h"
extern int debug;
@@ -120,7 +124,7 @@
}
if (level == 0) {
fprintf(where,"Invalid confidence_level of %s", desired_level);
- fprintf(where," was specified! Using default confidence_level of 99%\n");
+ fprintf(where," was specified! Using default confidence_level of 99%%\n");
fflush(where);
level = 7;
}
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netlib.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -68,6 +68,13 @@
#include <netdb.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#include <poll.h>
#include <sys/resource.h>
#include <pthread.h>
@@ -381,7 +388,7 @@
if (debug) {
for (i=0;i < TEST_HASH_BUCKETS; i++) {
test = test_hash[i].test;
- fprintf(where,"test_hash[%d]=%lx\n",i,test_hash[i].test);
+ fprintf(where,"test_hash[%d]=%p\n",i,test_hash[i].test);
while (test) {
fprintf(where,"\ttest->id %s, test->state %d\n",
test->id,test->state);
@@ -881,7 +888,7 @@
/* pthread_create succeeded detach thread so we don't need to join */
*tid = temp_tid;
if (debug) {
- fprintf(where,"launch_thread: pthread_create succeeded id = %d\n",tid);
+ fprintf(where,"launch_thread: pthread_create succeeded id = %d\n",*tid);
fflush(where);
}
rc = pthread_detach(temp_tid);
Modified: trunk/src/netperf.c
===================================================================
--- trunk/src/netperf.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netperf.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -353,7 +353,7 @@
server_t * server;
for (i=0;i < SERVER_HASH_BUCKETS; i++) {
server = server_hash[i].server;
- fprintf(where,"server_hash_bucket[%d]=%lx\n",i,server_hash[i].server);
+ fprintf(where,"server_hash_bucket[%d]=%p\n",i,server_hash[i].server);
while (server) {
fprintf(where,"\tserver->id %s, server->sock %d, server->state %d\n",
server->id,server->sock,server->state);
Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netserver.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -745,14 +745,14 @@
static void
setup_listen_endpoint(char service[]) {
- struct sockaddr name;
- struct sockaddr *peeraddr = &name;
- int namelen = sizeof(name);
- int peerlen = namelen;
- int sock;
- int rc;
- int listenfd = 0;
- int loop = 1;
+ struct sockaddr name;
+ struct sockaddr *peeraddr = &name;
+ int namelen = sizeof(name);
+ netperf_socklen_t peerlen = namelen;
+ int sock;
+ int rc;
+ int listenfd = 0;
+ int loop = 1;
NETPERF_DEBUG_ENTRY(debug,where);
@@ -910,7 +910,7 @@
int rc;
int sock;
struct sockaddr name;
- int namelen = sizeof(name);
+ netperf_socklen_t namelen = sizeof(name);
program_name = argv[0];
Modified: trunk/src/netsysstats_common.c
===================================================================
--- trunk/src/netsysstats_common.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netsysstats_common.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -52,6 +52,13 @@
#include <string.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#include <errno.h>
#include "netperf.h"
@@ -260,7 +267,7 @@
NETPERF_DEBUG_ENTRY(test->debug,test->where);
- sprintf(value_str,"%#ld",value);
+ sprintf(value_str,"%d",value);
ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value_str);
if (test->debug) {
fprintf(test->where,"%s=%s\n",name,value_str);
Modified: trunk/src/netsysstats_linux.c
===================================================================
--- trunk/src/netsysstats_linux.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/netsysstats_linux.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -103,7 +103,6 @@
sys_cpu_util_init(test_t *test)
{
- int err;
netsysstat_data_t *tsd = GET_TEST_DATA(test);
NETPERF_DEBUG_ENTRY(test->debug,test->where);
@@ -146,7 +145,7 @@
test_t *test)
{
- int i,space,records;
+ int i,records;
char *p = proc_stat_buf;
char cpunam[64];
uint64_t nicetime;
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/nettest_bsd.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -77,10 +77,19 @@
#include <string.h>
#include <errno.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#ifdef OFF
#include <netinet/in.h>
#endif
+#include <netinet/tcp.h>
+
#include <sys/socket.h>
#include <netdb.h>
@@ -773,7 +782,6 @@
int error;
struct addrinfo hints;
struct addrinfo *local_ai;
- struct addrinfo *local_temp;
/* allocate memory to store the information about this test */
new_data = (bsd_data_t *)malloc(sizeof(bsd_data_t));
@@ -971,7 +979,7 @@
{
xmlNodePtr stats = NULL;
xmlAttrPtr ap = NULL;
- int i,j;
+ int i;
char value[32];
char name[32];
uint64_t loc_cnt[BSD_MAX_COUNTERS];
@@ -997,7 +1005,7 @@
if (GET_TEST_STATE == TEST_MEASURE) {
gettimeofday(&(my_data->curr_time), NULL);
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_sec);
+ sprintf(value,"%ld",my_data->curr_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_sec=%s\n",value);
@@ -1005,7 +1013,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_usec);
+ sprintf(value,"%ld",my_data->curr_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_usec=%s\n",value);
@@ -1014,7 +1022,7 @@
}
} else {
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_sec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_sec=%s\n",value);
@@ -1022,7 +1030,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_usec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_usec=%s\n",value);
@@ -1385,8 +1393,6 @@
static void
send_tcp_stream_idle_link(test_t *test)
{
- int len;
- uint32_t new_state;
bsd_data_t *my_data;
char *proc_name;
@@ -2417,7 +2423,7 @@
fprintf(outfd,
"bsd_test_results_init: malloc failed can't generate report\n");
fflush(outfd);
- exit;
+ exit(-1);
}
}
@@ -2561,7 +2567,6 @@
FILE *outfd;
bsd_results_t *rd;
double elapsed_seconds;
- double sys_util;
double calibration;
double local_idle;
double local_busy;
@@ -2743,7 +2748,7 @@
fprintf(test_set->where,
"exiting netperf now!!\n");
fflush(test_set->where);
- exit;
+ exit(-1);
}
set_elt = set_elt->next;
}
Modified: trunk/src/nettest_dns.c
===================================================================
--- trunk/src/nettest_dns.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/nettest_dns.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -60,6 +60,13 @@
#include <stdio.h>
#include <values.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -74,6 +81,8 @@
#include <netinet/in.h>
#endif
+#include <netinet/tcp.h>
+
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
@@ -763,7 +772,6 @@
int error;
struct addrinfo hints;
struct addrinfo *local_ai;
- struct addrinfo *local_temp;
/* allocate memory to store the information about this test */
new_data = (dns_data_t *)malloc(sizeof(dns_data_t));
@@ -949,7 +957,7 @@
{
xmlNodePtr stats = NULL;
xmlAttrPtr ap = NULL;
- int i,j;
+ int i;
char value[32];
char name[32];
uint64_t loc_cnt[DNS_MAX_COUNTERS];
@@ -975,7 +983,7 @@
if (GET_TEST_STATE == TEST_MEASURE) {
gettimeofday(&(my_data->curr_time), NULL);
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_sec);
+ sprintf(value,"%ld",my_data->curr_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_sec=%s\n",value);
@@ -983,7 +991,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_usec);
+ sprintf(value,"%ld",my_data->curr_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_usec=%s\n",value);
@@ -992,7 +1000,7 @@
}
} else {
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_sec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_sec=%s\n",value);
@@ -1000,7 +1008,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_usec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_usec=%s\n",value);
@@ -1364,6 +1372,7 @@
static int
recv_dns_responses(test_t *test)
{
+ return(0);
}
static uint32_t
@@ -1865,7 +1874,7 @@
fprintf(outfd,
"dns_test_results_init: malloc failed can't generate report\n");
fflush(outfd);
- exit;
+ exit(-1);
}
}
@@ -2186,7 +2195,7 @@
fprintf(test_set->where,
"exiting netperf now!!\n");
fflush(test_set->where);
- exit;
+ exit(-1);
}
set_elt = set_elt->next;
}
Modified: trunk/src/nettest_vst.c
===================================================================
--- trunk/src/nettest_vst.c 2006-01-23 21:41:11 UTC (rev 37)
+++ trunk/src/nettest_vst.c 2006-01-23 22:27:04 UTC (rev 38)
@@ -56,10 +56,19 @@
#include <signal.h>
#include <errno.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIM
+#include <time.h>
+#endif
+#endif
+
#ifdef OFF
#include <netinet/in.h>
#endif
+#include <netinet/tcp.h>
+
#include <sys/socket.h>
#include <netdb.h>
@@ -1416,7 +1425,7 @@
if (GET_TEST_STATE == TEST_MEASURE) {
gettimeofday(&(my_data->curr_time), NULL);
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_sec);
+ sprintf(value,"%ld",my_data->curr_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_sec=%s\n",value);
@@ -1424,7 +1433,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->curr_time.tv_usec);
+ sprintf(value,"%ld",my_data->curr_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"time_usec=%s\n",value);
@@ -1434,7 +1443,7 @@
}
else {
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_sec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_sec=%s\n",value);
@@ -1442,7 +1451,7 @@
}
}
if (ap != NULL) {
- sprintf(value,"%#ld",my_data->elapsed_time.tv_usec);
+ sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
if (test->debug) {
fprintf(test->where,"elapsed_usec=%s\n",value);
More information about the netperf-dev
mailing list