Recent changes

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

 



The following changes since commit a0741cbb98a0399d26e90cb05604bbfb20a45bc6:

  Fix parse strlen() bug (2010-03-05 12:46:37 +0100)

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

Jens Axboe (1):
      Make profile io op overrides a dedicated structure

 fio.h     |    4 ++--
 io_u.c    |   24 +++++++++++++++++++-----
 parse.c   |    2 ++
 profile.c |    4 ++--
 profile.h |   15 ++++++++++-----
 5 files changed, 35 insertions(+), 14 deletions(-)

---

Diff of recent changes:

diff --git a/fio.h b/fio.h
index 751fc3d..09cd01c 100644
--- a/fio.h
+++ b/fio.h
@@ -30,6 +30,7 @@
 #include "iolog.h"
 #include "helpers.h"
 #include "options.h"
+#include "profile.h"
 
 #ifdef FIO_HAVE_GUASI
 #include <guasi.h>
@@ -430,8 +431,7 @@ struct thread_data {
 	/*
 	 * Can be overloaded by profiles
 	 */
-	int (*fill_io_u_off)(struct thread_data *, struct io_u *);
-	int (*fill_io_u_size)(struct thread_data *, struct io_u *);
+	struct prof_io_ops prof_io_ops;
 };
 
 /*
diff --git a/io_u.c b/io_u.c
index 278d47a..9b9570e 100644
--- a/io_u.c
+++ b/io_u.c
@@ -233,8 +233,10 @@ static int __get_next_offset(struct thread_data *td, struct io_u *io_u)
 
 static int get_next_offset(struct thread_data *td, struct io_u *io_u)
 {
-	if (td->fill_io_u_off)
-		return td->fill_io_u_off(td, io_u);
+	struct prof_io_ops *ops = &td->prof_io_ops;
+
+	if (ops->fill_io_u_off)
+		return ops->fill_io_u_off(td, io_u);
 
 	return __get_next_offset(td, io_u);
 }
@@ -286,8 +288,10 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
 
 static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u)
 {
-	if (td->fill_io_u_size)
-		return td->fill_io_u_size(td, io_u);
+	struct prof_io_ops *ops = &td->prof_io_ops;
+
+	if (ops->fill_io_u_size)
+		return ops->fill_io_u_size(td, io_u);
 
 	return __get_next_buflen(td, io_u);
 }
@@ -785,7 +789,7 @@ static struct fio_file *get_next_file_rr(struct thread_data *td, int goodf,
 	return f;
 }
 
-static struct fio_file *get_next_file(struct thread_data *td)
+static struct fio_file *__get_next_file(struct thread_data *td)
 {
 	struct fio_file *f;
 
@@ -820,6 +824,16 @@ out:
 	return f;
 }
 
+static struct fio_file *get_next_file(struct thread_data *td)
+{
+	struct prof_io_ops *ops = &td->prof_io_ops;
+
+	if (ops->get_next_file)
+		return ops->get_next_file(td);
+
+	return __get_next_file(td);
+}
+
 static int set_io_u_file(struct thread_data *td, struct io_u *io_u)
 {
 	struct fio_file *f;
diff --git a/parse.c b/parse.c
index 9e3c5b1..ff6a873 100644
--- a/parse.c
+++ b/parse.c
@@ -825,6 +825,8 @@ int show_cmd_help(struct fio_option *options, const char *name)
 	int found = 0;
 	int show_all = 0;
 
+	printf("exec_profile=%s\n", exec_profile);
+
 	if (!name || !strcmp(name, "all"))
 		show_all = 1;
 
diff --git a/profile.c b/profile.c
index 0e2b97d..3ed9127 100644
--- a/profile.c
+++ b/profile.c
@@ -93,6 +93,6 @@ void profile_add_hooks(struct thread_data *td)
 	if (!ops)
 		return;
 
-	td->fill_io_u_off = ops->fill_io_u_off;
-	td->fill_io_u_size = ops->fill_io_u_size;
+	if (ops->io_ops)
+		td->prof_io_ops = *ops->io_ops;
 }
diff --git a/profile.h b/profile.h
index 3bae500..a54f072 100644
--- a/profile.h
+++ b/profile.h
@@ -3,6 +3,15 @@
 
 #include "flist.h"
 
+/*
+ * Functions for overriding internal fio io_u functions
+ */
+struct prof_io_ops {
+	int (*fill_io_u_off)(struct thread_data *, struct io_u *);
+	int (*fill_io_u_size)(struct thread_data *, struct io_u *);
+	struct fio_file *(*get_next_file)(struct thread_data *);
+};
+
 struct profile_ops {
 	struct flist_head list;
 	char name[32];
@@ -24,11 +33,7 @@ struct profile_ops {
 	 */
 	const char **cmdline;
 
-	/*
-	 * Functions for overriding internal fio io_u functions
-	 */
-	int (*fill_io_u_off)(struct thread_data *, struct io_u *);
-	int (*fill_io_u_size)(struct thread_data *, struct io_u *);
+	struct prof_io_ops *io_ops;
 };
 
 int register_profile(struct profile_ops *);
--
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