Recent changes (master)
The following changes since commit 1d31d1bcffe0b282aaadca12dc83d2dd671b84f2:
parse: remove the arithmetic parser checking (2014-12-17 13:27:32 -0700)
are available in the git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 2243dfc796a8a6e137893a57a77949df7657dd71:
options: add debug code for failure to lookup option names (2014-12-18 21:51:21 -0700)
----------------------------------------------------------------
Jens Axboe (4):
t/btrace2fio: add ability to add specific options through -a Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
mutex: add __fio_mutex_remove()
options: add debug code for failure to lookup option names
filelock.c | 5 +++-- mutex.c | 7 ++++++- mutex.h | 1 + options.c | 2 +- options.h | 11 +++++++++-- server.c | 1 + t/btrace2fio.c | 15 ++++++++++++++- 7 files changed, 35 insertions(+), 7 deletions(-)
---
Diff of recent changes:
filelock.c +3 -2
@@ -144,10 +144,11 @@ void fio_unlock_file(const char *fname) ff =fio_hash_find (hash);if (ff) { - ff->references--; +int refs = --ff->references;fio_mutex_up (&ff->lock); -if (!ff->references) { +if (!refs) {flist_del (&ff->list); +__fio_mutex_remove (&ff->lock);sfree (ff); } }else
mutex.c +6 -1
@@ -18,10 +18,15 @@#include "fio_time.h" #include "gettime.h" -void fio_mutex_remove (struct fio_mutex *mutex) +void __fio_mutex_remove (struct fio_mutex *mutex) {assert (mutex->magic ==FIO_MUTEX_MAGIC );pthread_cond_destroy (&mutex->cond); +} + +void fio_mutex_remove (struct fio_mutex *mutex) +{ +__fio_mutex_remove (mutex);munmap ((void *) mutex,sizeof (*mutex)); }
mutex.h +1 -0
@@ -26,6 +26,7 @@ enum {extern int __fio_mutex_init (struct fio_mutex *,int );extern struct fio_mutex *fio_mutex_init (int ); +extern void __fio_mutex_remove (struct fio_mutex *);extern void fio_mutex_remove (struct fio_mutex *);extern void fio_mutex_up (struct fio_mutex *);extern void fio_mutex_down (struct fio_mutex *);
options.c +1 -1
@@ -4206,7 +4206,7 @@ int __fio_option_is_set(struct thread_options *o, unsigned int off1)if (!opt) {log_err ("fio: no option found at offset %u\n" , off1); -return 0 ; +return -1 ; } opt_off = opt - &fio_options[0 ];
options.h +9 -2
@@ -24,8 +24,15 @@ extern struct fio_option fio_options[FIO_MAX_OPTS];extern int __fio_option_is_set (struct thread_options *,unsigned int off); -#define fio_option_is_set (__td, name) \ - __fio_option_is_set((__td), td_var_offset(name)) +#define fio_option_is_set (__td, name) \ +({ \ + int __r = __fio_option_is_set((__td), td_var_offset(name)); \ + if (__r == -1) { \ + log_err("fio: wanted %s\n", __fio_stringify(name)); \ + __r = 0; \ + } \ + __r; \ +})extern void fio_option_mark_set (struct thread_options *,struct fio_option *);
server.c +1 -0
@@ -1431,6 +1431,7 @@ fail: *datap = data;sfree (rep->data); +__fio_mutex_remove (&rep->lock);sfree (rep);return 0 ; }
t/btrace2fio.c +14 -1
@@ -24,6 +24,9 @@ static unsigned int max_depth = 256;static int output_ascii =1 ;static char *filename; +static char **add_opts; +static int n_add_opts; +/* * Collapse defaults */
@@ -752,6 +755,10 @@ static int __output_p_fio(struct btrace_pid *p, unsigned long *ios)printf ("\n" ); } +if (n_add_opts) +for (i =0 ; i < n_add_opts; i++) +printf ("%s\n" , add_opts[i]); +printf ("\n" );return 0 ; }
@@ -1020,6 +1027,7 @@ static int usage(char *argv[])log_err ("\t-c\tCollapse \"identical\" jobs (def=%u)\n" , collapse_entries);log_err ("\t-u\tDepth difference for collapse (def=%u)\n" , depth_diff);log_err ("\t-x\tRandom difference for collapse (def=%u)\n" , random_diff); +log_err ("\t-a\tAdditional fio option to add to job file\n" );return 1 ; }
@@ -1075,7 +1083,7 @@ int main(int argc, char *argv[])if (argc <2 )return usage (argv); -while ((c =getopt (argc, argv,"t:n:fd:r:RD:c:u:x:" )) !=-1 ) { +while ((c =getopt (argc, argv,"t:n:fd:r:RD:c:u:x:a:" )) !=-1 ) {switch (c) {case 'R' : set_rate =1 ;
@@ -1107,6 +1115,11 @@ int main(int argc, char *argv[])case 'x' : random_diff =atoi (optarg);break ; +case 'a' : + add_opts =realloc (add_opts, (n_add_opts +1 ) *sizeof (char *)); + add_opts[n_add_opts] =strdup (optarg); + n_add_opts++; +break ;case '?' :default :return usage (argv);