the file needs to be turned into a blkparse binary data
file first (blktrace <device> -d file_for_fio.bin).
-write_bw_log If given, write a bandwidth log of the jobs in this job
+write_bw_log=str If given, write a bandwidth log of the jobs in this job
file. Can be used to store data of the bandwidth of the
jobs in their lifetime. The included fio_generate_plots
script uses gnuplot to turn these text files into nice
- graphs.
+ graphs. See write_log_log for behaviour of given
+ filename. For this option, the postfix is _bw.log.
-write_lat_log Same as write_bw_log, except that this option stores io
- completion latencies instead.
+write_lat_log=str Same as write_bw_log, except that this option stores io
+ completion latencies instead. If no filename is given
+ with this option, the default filename of "jobname_type.log"
+ is used. Even if the filename is given, fio will still
+ append the type of log. So if one specifies
+
+ write_lat_log=foo
+
+ The actual log names will be foo_clat.log and foo_slat.log.
+ This helps fio_generate_plot fine the logs automatically.
lockmem=siint Pin down the specified amount of memory with mlock(2). Can
potentially be used instead of removing memory or booting
td->ts.io_bytes[0] = td->io_bytes[0];
td->ts.io_bytes[1] = td->io_bytes[1];
- if (td->ts.bw_log)
- finish_log(td, td->ts.bw_log, "bw");
- if (td->ts.slat_log)
- finish_log(td, td->ts.slat_log, "slat");
- if (td->ts.clat_log)
- finish_log(td, td->ts.clat_log, "clat");
+ if (td->ts.bw_log) {
+ if (td->o.bw_log_file)
+ finish_log_named(td, td->ts.bw_log, td->o.bw_log_file, "bw");
+ else
+ finish_log(td, td->ts.bw_log, "bw");
+ }
+ if (td->ts.slat_log) {
+ if (td->o.lat_log_file)
+ finish_log_named(td, td->ts.slat_log, td->o.lat_log_file, "clat");
+ else
+ finish_log(td, td->ts.slat_log, "slat");
+ }
+ if (td->ts.clat_log) {
+ if (td->o.lat_log_file)
+ finish_log_named(td, td->ts.clat_log, td->o.lat_log_file, "clat");
+ else
+ finish_log(td, td->ts.clat_log, "clat");
+ }
if (td->o.exec_postrun) {
if (system(td->o.exec_postrun) < 0)
log_err("fio: postrun %s failed\n", td->o.exec_postrun);
char *read_iolog_file;
char *write_iolog_file;
+ char *bw_log_file;
+ char *lat_log_file;
/*
* Pre-run and post-run shell
extern void update_io_ticks(void);
extern void setup_log(struct io_log **);
extern void finish_log(struct thread_data *, struct io_log *, const char *);
+extern void finish_log_named(struct thread_data *, struct io_log *, const char *, const char *);
extern void __finish_log(struct io_log *, const char *);
extern struct io_log *agg_io_log[2];
extern int write_bw_log;
free(log);
}
-void finish_log(struct thread_data *td, struct io_log *log, const char *name)
+void finish_log_named(struct thread_data *td, struct io_log *log,
+ const char *prefix, const char *postfix)
{
char file_name[256], *p;
- snprintf(file_name, 200, "%s_%s.log", td->o.name, name);
+ snprintf(file_name, 200, "%s_%s.log", prefix, postfix);
p = basename(file_name);
__finish_log(log, p);
}
+
+void finish_log(struct thread_data *td, struct io_log *log, const char *name)
+{
+ finish_log_named(td, log, td->o.name, name);
+}
return 0;
}
+static int str_write_bw_log_cb(void *data, const char *str)
+{
+ struct thread_data *td = data;
+
+ if (str)
+ td->o.bw_log_file = strdup(str);
+
+ td->o.write_bw_log = 1;
+ return 0;
+}
+
+static int str_write_lat_log_cb(void *data, const char *str)
+{
+ struct thread_data *td = data;
+
+ if (str)
+ td->o.lat_log_file = strdup(str);
+
+ td->o.write_lat_log = 1;
+ return 0;
+}
+
static int str_gtod_reduce_cb(void *data, int *il)
{
struct thread_data *td = data;
},
{
.name = "write_bw_log",
- .type = FIO_OPT_STR_SET,
+ .type = FIO_OPT_STR,
.off1 = td_var_offset(write_bw_log),
+ .cb = str_write_bw_log_cb,
.help = "Write log of bandwidth during run",
},
{
.name = "write_lat_log",
- .type = FIO_OPT_STR_SET,
+ .type = FIO_OPT_STR,
.off1 = td_var_offset(write_lat_log),
+ .cb = str_write_lat_log_cb,
.help = "Write log of latency during run",
},
{
dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name,
o->type, ptr);
- if (!ptr && o->type != FIO_OPT_STR_SET) {
+ if (!ptr && o->type != FIO_OPT_STR_SET && o->type != FIO_OPT_STR) {
fprintf(stderr, "Option %s requires an argument\n", o->name);
return 1;
}