svn commit: samba r21216 - in branches/SAMBA_4_0/source/torture/raw: .

tridge at samba.org tridge at samba.org
Wed Feb 7 07:11:20 GMT 2007


Author: tridge
Date: 2007-02-07 07:11:20 +0000 (Wed, 07 Feb 2007)
New Revision: 21216

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21216

Log:

fail the RAW-BENCH-LOCK test if the locking doesn't happen evenly
across the connections

Modified:
   branches/SAMBA_4_0/source/torture/raw/lockbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/lockbench.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/lockbench.c	2007-02-07 07:10:23 UTC (rev 21215)
+++ branches/SAMBA_4_0/source/torture/raw/lockbench.c	2007-02-07 07:11:20 UTC (rev 21216)
@@ -105,7 +105,7 @@
 	struct timeval tv;
 	struct event_context *ev = event_context_find(mem_ctx);
 	struct benchlock_state *state;
-	int total = 0, loops=0;
+	int total = 0, loops=0, minops=0;
 	NTSTATUS status;
 	
 	nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
@@ -176,6 +176,15 @@
 	}
 
 	printf("%.2f ops/second\n", total/timeval_elapsed(&tv));
+	minops = state[0].count;
+	for (i=0;i<nprocs;i++) {
+		printf("[%d] %u ops\n", i, state[i].count);
+		if (state[i].count < minops) minops = state[i].count;
+	}
+	if (minops < 0.5*total/nprocs) {
+		printf("Failed: unbalanced locking\n");
+		goto failed;
+	}
 
 	for (i=0;i<nprocs;i++) {
 		talloc_free(state[i].req);



More information about the samba-cvs mailing list