Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 31d23f47d5ee53f74fbf20e17e83c7cb42e39878:

  Fix bsrange read,write value option pairs (2011-07-23 21:07:13 +0200)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Bruce Cran (1):
      Add version number to --help output

Jens Axboe (1):
      Add proper include to silence build warning on NetBSD/FreeBSD

Yu-ju Hong (1):
      stats: Fix computation of summed standard deviation

 init.c          |    1 +
 os/os-freebsd.h |    1 +
 os/os-netbsd.h  |    1 +
 stat.c          |   19 +++++++++++++------
 4 files changed, 16 insertions(+), 6 deletions(-)

---

Diff of recent changes:

diff --git a/init.c b/init.c
index 98e10f7..9b386c5 100644
--- a/init.c
+++ b/init.c
@@ -1021,6 +1021,7 @@ static int setup_thread_area(void)
 
 static void usage(const char *name)
 {
+	printf("%s\n", fio_version_string);
 	printf("%s [options] [job options] <job file(s)>\n", name);
 	printf("\t--debug=options\tEnable debug logging\n");
 	printf("\t--output\tWrite output to file\n");
diff --git a/os/os-freebsd.h b/os/os-freebsd.h
index fad051f..317d403 100644
--- a/os/os-freebsd.h
+++ b/os/os-freebsd.h
@@ -4,6 +4,7 @@
 #include <errno.h>
 #include <sys/sysctl.h>
 #include <sys/disk.h>
+#include <sys/thr.h>
 
 #include "../file.h"
 
diff --git a/os/os-netbsd.h b/os/os-netbsd.h
index 7f5f484..e03866d 100644
--- a/os/os-netbsd.h
+++ b/os/os-netbsd.h
@@ -3,6 +3,7 @@
 
 #include <errno.h>
 #include <sys/param.h>
+#include <sys/thr.h>
 /* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
 #define	rb_node	_rb_node
 #include <sys/sysctl.h>
diff --git a/stat.c b/stat.c
index 9f22c6e..8be4be5 100644
--- a/stat.c
+++ b/stat.c
@@ -474,21 +474,28 @@ static void sum_stat(struct io_stat *dst, struct io_stat *src, int nr)
 
 	dst->min_val = min(dst->min_val, src->min_val);
 	dst->max_val = max(dst->max_val, src->max_val);
-	dst->samples += src->samples;
 
 	/*
-	 * Needs a new method for calculating stddev, we cannot just
-	 * average them we do below for nr > 1
+	 * Compute new mean and S after the merge
+	 * <http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+	 *  #Parallel_algorithm>
 	 */
 	if (nr == 1) {
 		mean = src->mean;
 		S = src->S;
 	} else {
-		mean = ((src->mean * (double) (nr - 1))
-				+ dst->mean) / ((double) nr);
-		S = ((src->S * (double) (nr - 1)) + dst->S) / ((double) nr);
+		double delta = src->mean - dst->mean;
+
+		mean = ((src->mean * src->samples) +
+			(dst->mean * dst->samples)) /
+			(dst->samples + src->samples);
+
+		S =  src->S + dst->S + pow(delta, 2.0) *
+			(dst->samples * src->samples) /
+			(dst->samples + src->samples);
 	}
 
+	dst->samples += src->samples;
 	dst->mean = mean;
 	dst->S = S;
 }
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux