[netperf-dev] netperf4 commit notice r65 - trunk/src
burger at netperf.org
burger at netperf.org
Fri Feb 24 07:56:55 PST 2006
Author: burger
Date: 2006-02-24 07:56:53 -0800 (Fri, 24 Feb 2006)
New Revision: 65
Modified:
trunk/src/netperf.c
trunk/src/nettest_bsd.c
trunk/src/nettest_bsd.h
Log:
Fixed bug in initialize_test with resolving dependency (file netperf.c).
If a comment was included in the test definition dependency wouldn't resolve.
Added the capability to see per processor CPU stats to report_bsd_test_results.
Setting report_flags="PRINT_ALL" prints per processor stats.
Fixed problem with elapsed time in report_bsd_test_results.
Stephen Burger
Modified: trunk/src/netperf.c
===================================================================
--- trunk/src/netperf.c 2006-02-23 20:37:26 UTC (rev 64)
+++ trunk/src/netperf.c 2006-02-24 15:56:53 UTC (rev 65)
@@ -770,9 +770,7 @@
fprintf(where,"calling recv_control_message\n");
fflush(where);
}
- pthread_rwlock_rdlock(&server->rwlock);
rc = recv_control_message(server->sock, &message);
- pthread_rwlock_unlock(&server->rwlock);
if (rc > 0) {
if (debug) {
fprintf(where,"wait_for_version_response ");
@@ -945,6 +943,12 @@
server = find_server_in_hash(test->server_id);
if (rc == NPE_SUCCESS) {
+ if (debug) {
+ fprintf(where,
+ "%s: %s dependencey on %s successfully resolved\n",
+ __func__, test->id, id);
+ fflush(where);
+ }
/* any dependency has been successfully resolved
now build the test message to send to the netserver */
if ((msg = xmlCopyNode(test->node,1)) != NULL) {
@@ -956,6 +960,7 @@
xmlReplaceNode(cur,dep_data);
break;
}
+ cur = cur->next;
}
}
/* is the lock around the send required? */
@@ -966,6 +971,12 @@
my_nid);
pthread_rwlock_unlock(&server->rwlock);
} else {
+ if (debug) {
+ fprintf(where,
+ "%s: %s xmlCopyNode failed\n",
+ __func__, test->id);
+ fflush(where);
+ }
rc = NPE_INIT_TEST_XMLCOPYNODE_FAILED;
}
}
@@ -1053,9 +1064,7 @@
fds.revents = 0;
pthread_mutex_unlock(server->lock);
if (poll(&fds,1,5000) > 0) {
- pthread_rwlock_rdlock(&server->rwlock);
rc = recv_control_message(server->sock, &message);
- pthread_rwlock_unlock(&server->rwlock);
if (rc > 0) {
rc = process_message(server, message);
} else {
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-02-23 20:37:26 UTC (rev 64)
+++ trunk/src/nettest_bsd.c 2006-02-24 15:56:53 UTC (rev 65)
@@ -2440,19 +2440,21 @@
rd->sd_denominator = 0.0;
if (NULL != report_flags) {
if (!strcmp(report_flags,"PRINT_RUN")) {
- rd->print_run = 1;
+ rd->print_run = 1;
}
if (!strcmp(report_flags,"PRINT_TESTS")) {
- rd->print_test = 1;
+ rd->print_test = 1;
}
if (!strcmp(report_flags,"PRINT_ALL")) {
- rd->print_run = 1;
- rd->print_test = 1;
+ rd->print_run = 1;
+ rd->print_test = 1;
+ rd->print_per_cpu = 1;
}
}
if (test_set->debug) {
- rd->print_run = 1;
- rd->print_test = 1;
+ rd->print_run = 1;
+ rd->print_test = 1;
+ rd->print_per_cpu = 1;
}
test_set->report_data = rd;
} else {
@@ -2603,6 +2605,8 @@
int index;
FILE *outfd;
bsd_results_t *rd;
+ char *value_str;
+ xmlNodePtr cpu;
double elapsed_seconds;
double calibration;
double local_idle;
@@ -2640,7 +2644,7 @@
fflush(test_set->where);
}
for (i=0; i<MAX_SYS_CNTRS; i++) {
- char *value_str =
+ value_str =
(char *)xmlGetProp(stats, (const xmlChar *)sys_cntr_name[i]);
if (value_str) {
sys_cntr[i] = strtod(value_str,NULL);
@@ -2674,6 +2678,31 @@
fflush(test_set->where);
}
rd->utilization[index] += local_busy;
+
+ if (rd->print_per_cpu) {
+ 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 */
@@ -2762,12 +2791,12 @@
/* process system statistics */
num_of_cpus = process_sys_stats(test_set, stats, test->id);
stats_for_test++;
- num_of_tests++;
}
if(!xmlStrcmp(stats->name,(const xmlChar *)"test_stats")) {
/* process test statistics */
process_test_stats(test_set, stats, test->id);
stats_for_test++;
+ num_of_tests++;
}
/* other types of nodes just get skipped by this report routine */
/* delete statistics entry from test */
@@ -3133,7 +3162,7 @@
if ((count >= max_count) ||
((test_set->confidence.value >= 0) && (count >= min_count))) {
print_results_summary(test_set);
- if (test_set->confidence.value < 0) {
+ if ((test_set->confidence.value < 0) && (min_count > 1)) {
print_did_not_meet_confidence(test_set);
}
}
Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h 2006-02-23 20:37:26 UTC (rev 64)
+++ trunk/src/nettest_bsd.h 2006-02-24 15:56:53 UTC (rev 65)
@@ -127,6 +127,7 @@
int max_count;
int print_test;
int print_run;
+ int print_per_cpu;
FILE *outfd;
double *results;
double *xmit_results;
More information about the netperf-dev
mailing list