shithub: sysbench

Download patch

ref: 3c04d813ab19bd5b08cf7857b17976517de2ee71
parent: 721724916347c46df7cfa3105ac6fd1f6da652ed
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jul 14 18:13:05 EDT 2025

bench: don't access unavailable histogram

--- a/bench.c
+++ b/bench.c
@@ -92,8 +92,6 @@
 static void
 benchrunn(B *b, int n, Hist *h)
 {
-	vlong now;
-
 	// reset
 	b->ns = 0;
 	b->start = nanosec();
@@ -104,7 +102,6 @@
 
 	// count
 	cycles(&b->ecycles);
-	now = nanosec();
 	b->ns += nanosec() - b->start - b->overheadns;
 	b->bcycles += b->ecycles - b->scycles - b->overheadcy;
 	histrecord(h, b);
@@ -193,8 +190,6 @@
 	}
 
 	/* do the run */
-	h->min = -1;
-	h->max = -1;
 	/* estimate */
 	benchrunn(b, 1, h);
 	n = roundup(BENCHTIME, b->ns);
@@ -315,6 +310,8 @@
 	if(strncmp(name, "bench", 5) == 0)
 		name += 5;
 	print("%24s\t", name);
+	h.min = -1;
+	h.max = -1;
 	benchrun(&b, showhist ? &h : nil);
 	benchres(&b, showhist ? &h : nil);
 }
--