X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=f5ff73d067bb62229b3a45e4d9fe74ffc31f3bb0;hb=6dd7fa7789b67c73190b8c2006d799bee890cf23;hp=28061db8ea8f9a51d8e884c317ee3fc4309e11b1;hpb=5ec3bc5401f354444bdc0ce3c240df664f50d520;p=fio.git diff --git a/init.c b/init.c index 28061db8..f5ff73d0 100644 --- a/init.c +++ b/init.c @@ -4,14 +4,17 @@ #include #include #include -#include #include #include #include #include #include -#include #include +#ifdef CONFIG_VALGRIND_DEV +#include +#else +#define DRD_IGNORE_VAR(x) do { } while (0) +#endif #include "fio.h" #ifndef FIO_NO_HAVE_SHM_H @@ -333,6 +336,8 @@ static void free_shm(void) */ static int setup_thread_area(void) { + int i; + if (threads) return 0; @@ -376,6 +381,8 @@ static int setup_thread_area(void) #endif memset(threads, 0, max_jobs * sizeof(struct thread_data)); + for (i = 0; i < max_jobs; i++) + DRD_IGNORE_VAR(threads[i]); fio_debug_jobp = (unsigned int *)(threads + max_jobs); *fio_debug_jobp = -1; fio_warned = fio_debug_jobp + 1; @@ -1177,7 +1184,7 @@ static void init_flags(struct thread_data *td) fio_option_is_set(o, zero_buffers))) td->flags |= TD_F_SCRAMBLE_BUFFERS; if (o->verify != VERIFY_NONE) - td->flags |= TD_F_VER_NONE; + td->flags |= TD_F_DO_VERIFY; if (o->verify_async || o->io_submit_mode == IO_MODE_OFFLOAD) td->flags |= TD_F_NEED_LOCK; @@ -1471,7 +1478,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, f->real_file_size = -1ULL; } - td->mutex = fio_mutex_init(FIO_MUTEX_LOCKED); + td->sem = fio_sem_init(FIO_SEM_LOCKED); td->ts.clat_percentiles = o->clat_percentiles; td->ts.lat_percentiles = o->lat_percentiles; @@ -1963,7 +1970,8 @@ static int __parse_jobs_ini(struct thread_data *td, if (p[0] == '[') { if (nested) { log_err("No new sections in included files\n"); - return 1; + ret = 1; + goto out; } skip_fgets = 1; @@ -2094,7 +2102,7 @@ static int fill_def_thread(void) static void show_debug_categories(void) { #ifdef FIO_INC_DEBUG - struct debug_level *dl = &debug_levels[0]; + const struct debug_level *dl = &debug_levels[0]; int curlen, first = 1; curlen = 0; @@ -2184,7 +2192,7 @@ static void usage(const char *name) } #ifdef FIO_INC_DEBUG -struct debug_level debug_levels[] = { +const struct debug_level debug_levels[] = { { .name = "process", .help = "Process creation/exit logging", .shift = FD_PROCESS, @@ -2262,7 +2270,7 @@ struct debug_level debug_levels[] = { static int set_debug(const char *string) { - struct debug_level *dl; + const struct debug_level *dl; char *p = (char *) string; char *opt; int i;