Recent changes (master)

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

 



The following changes since commit 30b5d57f63c75ca60aca97ff2aa6f652ac775c30:

  Update man page with new command line options (2013-04-24 21:11:35 -0600)

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

Jens Axboe (4):
      Ensure we stop parsing and exit if a command line option fails
      Fix filling verify pattern for byte sizes of 3, 5, 7, ...
      parse: add debug output when enabled
      Catch the case where size= is less than the minimum block size

 fio.h     |    8 ++++++++
 init.c    |   10 ++++++++++
 options.c |   15 ++++++++++++++-
 parse.c   |    6 ++++++
 4 files changed, 38 insertions(+), 1 deletions(-)

---

Diff of recent changes:

diff --git a/fio.h b/fio.h
index ebf6309..5438b76 100644
--- a/fio.h
+++ b/fio.h
@@ -535,6 +535,14 @@ static inline unsigned int td_max_bs(struct thread_data *td)
 	return max(td->o.max_bs[DDIR_TRIM], max_bs);
 }
 
+static inline unsigned int td_min_bs(struct thread_data *td)
+{
+	unsigned int min_bs;
+
+	min_bs = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
+	return min(td->o.min_bs[DDIR_TRIM], min_bs);
+}
+
 static inline int is_power_of_2(unsigned int val)
 {
 	return (val != 0 && ((val & (val - 1)) == 0));
diff --git a/init.c b/init.c
index ff9b6d4..aba7671 100644
--- a/init.c
+++ b/init.c
@@ -621,6 +621,14 @@ static int fixup_options(struct thread_data *td)
 	if (td->o.random_distribution != FIO_RAND_DIST_RANDOM)
 		td->o.norandommap = 1;
 
+	/*
+	 * If size is set but less than the min block size, complain
+	 */
+	if (o->size && o->size < td_min_bs(td)) {
+		log_err("fio: size too small, must be larger than the IO size: %llu\n", (unsigned long long) o->size);
+		ret = 1;
+	}
+
 	return ret;
 }
 
@@ -1716,6 +1724,8 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
 			}
 
 			ret = fio_cmd_option_parse(td, opt, val);
+			if (ret)
+				do_exit++;
 
 			if (!ret && !strcmp(opt, "ioengine")) {
 				free_ioengine(td);
diff --git a/options.c b/options.c
index 3b04ffa..1219803 100644
--- a/options.c
+++ b/options.c
@@ -805,7 +805,7 @@ static int str_verify_pattern_cb(void *data, const char *input)
 {
 	struct thread_data *td = data;
 	long off;
-	int i = 0, j = 0, len, k, base = 10;
+	int i = 0, j = 0, len, k, base = 10, pattern_length;
 	char *loc1, *loc2;
 
 	loc1 = strstr(input, "0x");
@@ -844,10 +844,23 @@ static int str_verify_pattern_cb(void *data, const char *input)
 	 * Fill the pattern all the way to the end. This greatly reduces
 	 * the number of memcpy's we have to do when verifying the IO.
 	 */
+	pattern_length = i;
 	while (i > 1 && i * 2 <= MAX_PATTERN_SIZE) {
 		memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], i);
 		i *= 2;
 	}
+
+	/*
+	 * Fill remainder, if the pattern multiple ends up not being
+	 * MAX_PATTERN_SIZE.
+	 */
+	while (i > 1 && i < MAX_PATTERN_SIZE) {
+		unsigned int b = min(pattern_length, MAX_PATTERN_SIZE - i);
+
+		memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], b);
+		i += b;
+	}
+
 	if (i == 1) {
 		/*
 		 * The code in verify_io_u_pattern assumes a single byte pattern
diff --git a/parse.c b/parse.c
index 63c94e3..b8ec3aa 100644
--- a/parse.c
+++ b/parse.c
@@ -451,6 +451,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 		else
 			ret = check_str_bytes(tmp, &ull, data);
 
+		dprint(FD_PARSE, "  ret=%d, out=%llu\n", ret, ull);
+
 		if (ret)
 			break;
 
@@ -576,6 +578,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 		flp = td_var(data, o->off1);
 		flp[curr].u.f = uf;
 
+		dprint(FD_PARSE, "  out=%f\n", uf);
+
 		/*
 		** Calculate precision for output by counting
 		** number of digits after period. Find first
@@ -745,6 +749,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 		else
 			il = 1;
 
+		dprint(FD_PARSE, "  ret=%d, out=%d\n", ret, il);
+
 		if (ret)
 			break;
 
--
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