From a793580635d981a1f12f6158458bf80dae1e9b90 Mon Sep 17 00:00:00 2001 From: Sam Zaydel Date: Tue, 4 Sep 2018 14:28:29 -0700 Subject: [PATCH] Log files names start with _ when write_XX_log= keys in config file have empty value(s) --- init.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/init.c b/init.c index b925b4ca..392dda2c 100644 --- a/init.c +++ b/init.c @@ -1542,7 +1542,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; - const char *pre = o->lat_log_file ? o->lat_log_file : o->name; + const char *pre = + (o->lat_log_file && strcmp(o->lat_log_file, "") != 0) ? + o->lat_log_file : o->name; const char *suf; if (p.log_gz_store) @@ -1561,6 +1563,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, gen_log_name(logname, sizeof(logname), "clat", pre, td->thread_number, suf, o->per_job_logs); setup_log(&td->clat_log, &p, logname); + } if (o->write_hist_log) { @@ -1574,7 +1577,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; - const char *pre = o->hist_log_file ? o->hist_log_file : o->name; + const char *pre = + (o->hist_log_file && strcmp(o->hist_log_file, "") != 0) ? + o->hist_log_file : o->name; const char *suf; #ifndef CONFIG_ZLIB @@ -1605,7 +1610,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; - const char *pre = o->bw_log_file ? o->bw_log_file : o->name; + const char *pre = + (o->bw_log_file && strcmp(o->bw_log_file, "") != 0) ? + o->bw_log_file : o->name; const char *suf; if (fio_option_is_set(o, bw_avg_time)) @@ -1636,7 +1643,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, .log_gz = o->log_gz, .log_gz_store = o->log_gz_store, }; - const char *pre = o->iops_log_file ? o->iops_log_file : o->name; + const char *pre = + (o->iops_log_file && strcmp(o->iops_log_file, "") != 0) ? + o->iops_log_file : o->name; const char *suf; if (fio_option_is_set(o, iops_avg_time)) -- 2.25.1