Recent changes (gfio)

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

 



The following changes since commit d926d535c7e1a12ff1a57a718ed8e84f617b0172:

  parse: add posval support to FIO_OPT_INT (2013-04-09 21:02:15 +0200)

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

Jens Axboe (19):
      server: bump protocol version
      parse: add posval support to FIO_OPT_INT
      options: make unit_base be posval[] based
      parse: for option with posval, dump allowed values on failure
      Convert unit_base to posval[]
      Merge branch 'master' into gfio
      parse: don't print min/max option ranges if posval[] is set
      gfio: add option group/category to filename_format
      parse: catch all options without a group/category set
      parse: set invalid group on option with no group set
      Add group/category to numa/mem node options
      configure: gfio wording
      Add thread_options.h
      Unify options with gfio
      parse: bring in more stuff from gfio
      parse: fix spelling error
      Categorize engine and profile options
      tiobench: remove duplicate profile group
      Merge branch 'master' into gfio

 HOWTO              |    1 +
 configure          |    4 ++--
 engines/e4defrag.c |    4 ++++
 engines/libaio.c   |    3 ++-
 engines/net.c      |   15 ++++++++++++---
 fio.1              |    2 +-
 iolog.h            |    1 +
 options.c          |   31 ++++++++++++++++---------------
 options.h          |    8 ++++++++
 parse.c            |   16 +++++++++-------
 thread_options.h   |    3 ++-
 11 files changed, 58 insertions(+), 30 deletions(-)


---

Diff of recent changes:

diff --git a/HOWTO b/HOWTO
index 7dc7d48..c7d0c9e 100644
--- a/HOWTO
+++ b/HOWTO
@@ -1241,6 +1241,7 @@ log_avg_msec=int By default, fio will log an entry in the iops, latency,
 lockmem=int	Pin down the specified amount of memory with mlock(2). Can
 		potentially be used instead of removing memory or booting
 		with less memory to simulate a smaller amount of memory.
+		The amount specified is per worker.
 
 exec_prerun=str	Before running this job, issue the command specified
 		through system(3).
diff --git a/configure b/configure
index 1ca461d..4b71afd 100755
--- a/configure
+++ b/configure
@@ -955,7 +955,7 @@ fi
 echo "__thread                      $tls_thread"
 
 ##########################################
-# Whether or not __thread is supported for TLS
+# Check if we have required gtk/glib support for gfio
 if test "$gfio" = "yes" ; then
   cat > $TMPC << EOF
 #include <glib.h>
@@ -995,7 +995,7 @@ else
 fi
 fi
 
-echo "gfio                          $gfio"
+echo "gtk 2.18 or higher            $gfio"
 
 # Check whether we have getrusage(RUSAGE_THREAD)
 rusage_thread="no"
diff --git a/engines/e4defrag.c b/engines/e4defrag.c
index 6063e6c..d9ddf75 100644
--- a/engines/e4defrag.c
+++ b/engines/e4defrag.c
@@ -47,6 +47,8 @@ static struct fio_option options[] = {
 		.type	= FIO_OPT_STR_STORE,
 		.off1	= offsetof(struct e4defrag_options, donor_name),
 		.help	= "File used as a block donor",
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_E4DEFRAG,
 	},
 	{
 		.name	= "inplace",
@@ -55,6 +57,8 @@ static struct fio_option options[] = {
 		.minval	= 0,
 		.maxval	= 1,
 		.help	= "Alloc and free space inside defrag event",
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_E4DEFRAG,
 	},
 	{
 		.name	= NULL,
diff --git a/engines/libaio.c b/engines/libaio.c
index d668325..be54dca 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -33,7 +33,8 @@ static struct fio_option options[] = {
 		.type	= FIO_OPT_STR_SET,
 		.off1	= offsetof(struct libaio_options, userspace_reap),
 		.help	= "Use alternative user-space reap implementation",
-		.category = FIO_OPT_C_IO,
+		.category = FIO_OPT_C_ENGINE,
+		.category = FIO_OPT_G_LIBAIO,
 	},
 	{
 		.name	= NULL,
diff --git a/engines/net.c b/engines/net.c
index 566ad2d..eb6763e 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -62,7 +62,8 @@ static struct fio_option options[] = {
 		.type	= FIO_OPT_STR_STORE,
 		.cb	= str_hostname_cb,
 		.help	= "Hostname for net IO engine",
-		.category = FIO_OPT_C_IO,
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 	{
 		.name	= "port",
@@ -72,7 +73,8 @@ static struct fio_option options[] = {
 		.minval	= 1,
 		.maxval	= 65535,
 		.help	= "Port to use for TCP or UDP net connections",
-		.category = FIO_OPT_C_IO,
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 	{
 		.name	= "protocol",
@@ -97,6 +99,8 @@ static struct fio_option options[] = {
 			    .help = "UNIX domain socket",
 			  },
 		},
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 #ifdef CONFIG_TCP_NODELAY
 	{
@@ -104,6 +108,8 @@ static struct fio_option options[] = {
 		.type	= FIO_OPT_BOOL,
 		.off1	= offsetof(struct netio_options, nodelay),
 		.help	= "Use TCP_NODELAY on TCP connections",
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 #endif
 	{
@@ -112,13 +118,16 @@ static struct fio_option options[] = {
 		.type	= FIO_OPT_STR_SET,
 		.off1	= offsetof(struct netio_options, listen),
 		.help	= "Listen for incoming TCP connections",
-		.category = FIO_OPT_C_IO,
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 	{
 		.name	= "pingpong",
 		.type	= FIO_OPT_STR_SET,
 		.off1	= offsetof(struct netio_options, pingpong),
 		.help	= "Ping-pong IO requests",
+		.category = FIO_OPT_C_ENGINE,
+		.group	= FIO_OPT_G_NETIO,
 	},
 	{
 		.name	= NULL,
diff --git a/fio.1 b/fio.1
index dc13b98..eddc265 100644
--- a/fio.1
+++ b/fio.1
@@ -1034,7 +1034,7 @@ Disable measurements of throughput/bandwidth numbers. See \fBdisable_lat\fR.
 .TP
 .BI lockmem \fR=\fPint
 Pin the specified amount of memory with \fBmlock\fR\|(2).  Can be used to
-simulate a smaller amount of memory.
+simulate a smaller amount of memory. The amount specified is per worker.
 .TP
 .BI exec_prerun \fR=\fPstr
 Before running the job, execute the specified command with \fBsystem\fR\|(3).
diff --git a/iolog.h b/iolog.h
index af84e10..7099097 100644
--- a/iolog.h
+++ b/iolog.h
@@ -97,6 +97,7 @@ enum file_log_act {
 	FIO_LOG_UNLINK_FILE,
 };
 
+struct io_u;
 extern int __must_check read_iolog_get(struct thread_data *, struct io_u *);
 extern void log_io_u(struct thread_data *, struct io_u *);
 extern void log_file(struct thread_data *, struct fio_file *, enum file_log_act);
diff --git a/options.c b/options.c
index c838ee0..f5cab65 100644
--- a/options.c
+++ b/options.c
@@ -936,19 +936,6 @@ static int gtod_cpu_verify(struct fio_option *o, void *data)
 	return 0;
 }
 
-static int kb_base_verify(struct fio_option *o, void *data)
-{
-	struct thread_data *td = data;
-
-	if (td->o.kb_base != 1024 && td->o.kb_base != 1000) {
-		log_err("fio: kb_base set to nonsensical value: %u\n",
-				td->o.kb_base);
-		return 1;
-	}
-
-	return 0;
-}
-
 /*
  * Option grouping
  */
@@ -2353,7 +2340,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.lname	= "Lock memory",
 		.type	= FIO_OPT_STR_VAL,
 		.off1	= td_var_offset(lockmem),
-		.help	= "Lock down this amount of memory",
+		.help	= "Lock down this amount of memory (per worker)",
 		.def	= "0",
 		.interval = 1024 * 1024,
 		.category = FIO_OPT_C_GENERAL,
@@ -2630,12 +2617,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.type	= FIO_OPT_STR,
 		.cb	= str_numa_cpunodes_cb,
 		.help	= "NUMA CPU nodes bind",
+		.category = FIO_OPT_C_GENERAL,
+		.group	= FIO_OPT_G_INVALID,
 	},
 	{
 		.name	= "numa_mem_policy",
 		.type	= FIO_OPT_STR,
 		.cb	= str_numa_mpol_cb,
 		.help	= "NUMA memory policy setup",
+		.category = FIO_OPT_C_GENERAL,
+		.group	= FIO_OPT_G_INVALID,
 	},
 #endif
 	{
@@ -3072,15 +3063,25 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.lname	= "KB Base",
 		.type	= FIO_OPT_INT,
 		.off1	= td_var_offset(kb_base),
-		.verify	= kb_base_verify,
 		.prio	= 1,
 		.def	= "1024",
+		.posval = {
+			  { .ival = "1024",
+			    .oval = 1024,
+			    .help = "Use 1024 as the K base",
+			  },
+			  { .ival = "1000",
+			    .oval = 1000,
+			    .help = "Use 1000 as the K base",
+			  },
+		},
 		.help	= "How many bytes per KB for reporting (1000 or 1024)",
 		.category = FIO_OPT_C_GENERAL,
 		.group	= FIO_OPT_G_INVALID,
 	},
 	{
 		.name	= "unit_base",
+		.lname	= "Base unit for reporting (Bits or Bytes)",
 		.type	= FIO_OPT_INT,
 		.off1	= td_var_offset(unit_base),
 		.prio	= 1,
diff --git a/options.h b/options.h
index 330cc87..9702d47 100644
--- a/options.h
+++ b/options.h
@@ -54,6 +54,7 @@ enum opt_category {
 	__FIO_OPT_C_STAT,
 	__FIO_OPT_C_LOG,
 	__FIO_OPT_C_PROFILE,
+	__FIO_OPT_C_ENGINE,
 	__FIO_OPT_C_NR,
 
 	FIO_OPT_C_GENERAL	= (1U << __FIO_OPT_C_GENERAL),
@@ -62,6 +63,7 @@ enum opt_category {
 	FIO_OPT_C_STAT		= (1U << __FIO_OPT_C_STAT),
 	FIO_OPT_C_LOG		= (1U << __FIO_OPT_C_LOG),
 	FIO_OPT_C_PROFILE	= (1U << __FIO_OPT_C_PROFILE),
+	FIO_OPT_C_ENGINE	= (1U << __FIO_OPT_C_ENGINE),
 	FIO_OPT_C_INVALID	= (1U << __FIO_OPT_C_NR),
 };
 
@@ -88,6 +90,9 @@ enum opt_category_group {
 	__FIO_OPT_G_IO_BUF,
 	__FIO_OPT_G_TIOBENCH,
 	__FIO_OPT_G_ERR,
+	__FIO_OPT_G_E4DEFRAG,
+	__FIO_OPT_G_NETIO,
+	__FIO_OPT_G_LIBAIO,
 	__FIO_OPT_G_NR,
 
 	FIO_OPT_G_RATE		= (1U << __FIO_OPT_G_RATE),
@@ -112,6 +117,9 @@ enum opt_category_group {
 	FIO_OPT_G_IO_BUF	= (1U << __FIO_OPT_G_IO_BUF),
 	FIO_OPT_G_TIOBENCH	= (1U << __FIO_OPT_G_TIOBENCH),
 	FIO_OPT_G_ERR		= (1U << __FIO_OPT_G_ERR),
+	FIO_OPT_G_E4DEFRAG	= (1U << __FIO_OPT_G_E4DEFRAG),
+	FIO_OPT_G_NETIO		= (1U << __FIO_OPT_G_NETIO),
+	FIO_OPT_G_LIBAIO	= (1U << __FIO_OPT_G_LIBAIO),
 	FIO_OPT_G_INVALID	= (1U << __FIO_OPT_G_NR),
 };
 
diff --git a/parse.c b/parse.c
index 8885f59..e8b628c 100644
--- a/parse.c
+++ b/parse.c
@@ -49,7 +49,7 @@ static void posval_sort(struct fio_option *o, struct value_pair *vpmap)
 static void show_option_range(struct fio_option *o,
 				int (*logger)(const char *format, ...))
 {
-	if (o->type == FIO_OPT_FLOAT_LIST){
+	if (o->type == FIO_OPT_FLOAT_LIST) {
 		if (o->minfp == DBL_MIN && o->maxfp == DBL_MAX)
 			return;
 
@@ -57,7 +57,7 @@ static void show_option_range(struct fio_option *o,
 		if (o->maxfp != DBL_MAX)
 			logger(", max=%f", o->maxfp);
 		logger("\n");
-	} else {
+	} else if (!o->posval[0].ival) {
 		if (!o->minval && !o->maxval)
 			return;
 
@@ -478,7 +478,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 				}
 			}
 			if (ret) {
-				log_err("value %d not in allowed range\n",ull);
+				log_err("fio: value %llu not allowed:\n", ull);
+				show_option_values(o);
 				return 1;
 			}
 		}
@@ -1167,6 +1168,11 @@ void option_init(struct fio_option *o)
 	}
 	if (!o->cb && (!o->off1 && !o->roff1))
 		log_err("Option %s: neither cb nor offset given\n", o->name);
+	if (!o->category) {
+		log_info("Option %s: no category defined. Setting to misc\n", o->name);
+		o->category = FIO_OPT_C_GENERAL;
+		o->group = FIO_OPT_G_INVALID;
+	}
 	if (o->type == FIO_OPT_STR || o->type == FIO_OPT_STR_STORE ||
 	    o->type == FIO_OPT_STR_MULTI)
 		return;
@@ -1174,10 +1180,6 @@ void option_init(struct fio_option *o)
 		      (o->roff1 || o->roff2 || o->roff3 || o->roff4))) {
 		log_err("Option %s: both cb and offset given\n", o->name);
 	}
-	if (!o->category) {
-		log_info("Options %s: no category defined. Setting to misc\n", o->name);
-		o->category = FIO_OPT_C_GENERAL;
-	}
 }
 
 /*
diff --git a/thread_options.h b/thread_options.h
index a794949..68056df 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -123,6 +123,7 @@ struct thread_options {
 	unsigned int fsync_on_close;
 
 	unsigned int random_distribution;
+
 	fio_fp64_t zipf_theta;
 	fio_fp64_t pareto_h;
 
@@ -150,7 +151,7 @@ struct thread_options {
 	enum fio_memtype mem_type;
 	unsigned int mem_align;
 
-	unsigned max_latency;
+	unsigned int max_latency;
 
 	unsigned int stonewall;
 	unsigned int new_group;
--
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