summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bddc8d1)
If set, this generates bw/clat/iops log with per file private
filenames. If not set, jobs with identical names will share the
log filename. Default: true.
Signed-off-by: Jens Axboe <axboe@fb.com>
replay_scale=int Scale sector offsets down by this factor when
replaying traces.
replay_scale=int Scale sector offsets down by this factor when
replaying traces.
+per_job_logs=bool If set, this generates bw/clat/iops log with per
+ file private filenames. If not set, jobs with identical names
+ will share the log filename. Default: true.
+
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
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
graphs. See write_lat_log for behaviour of given
filename. For this option, the suffix is _bw.x.log, where
x is the index of the job (1..N, where N is the number of
graphs. See write_lat_log for behaviour of given
filename. For this option, the suffix is _bw.x.log, where
x is the index of the job (1..N, where N is the number of
+ jobs). If 'per_job_logs' is false, then the filename will not
+ include the job index.
write_lat_log=str Same as write_bw_log, except that this option stores io
submission, completion, and total latencies instead. If no
write_lat_log=str Same as write_bw_log, except that this option stores io
submission, completion, and total latencies instead. If no
The actual log names will be foo_slat.x.log, foo_clat.x.log,
and foo_lat.x.log, where x is the index of the job (1..N,
where N is the number of jobs). This helps fio_generate_plot
The actual log names will be foo_slat.x.log, foo_clat.x.log,
and foo_lat.x.log, where x is the index of the job (1..N,
where N is the number of jobs). This helps fio_generate_plot
- fine the logs automatically.
+ fine the logs automatically. If 'per_job_logs' is false, then
+ the filename will not include the job index.
+
write_iops_log=str Same as write_bw_log, but writes IOPS. If no filename is
given with this option, the default filename of
"jobname_type.x.log" is used,where x is the index of the job
(1..N, where N is the number of jobs). Even if the filename
write_iops_log=str Same as write_bw_log, but writes IOPS. If no filename is
given with this option, the default filename of
"jobname_type.x.log" is used,where x is the index of the job
(1..N, where N is the number of jobs). Even if the filename
- is given, fio will still append the type of log.
+ is given, fio will still append the type of log. If
+ 'per_job_logs' is false, then the filename will not include
+ the job index.
log_avg_msec=int By default, fio will log an entry in the iops, latency,
or bw log for every IO that completes. When writing to the
log_avg_msec=int By default, fio will log an entry in the iops, latency,
or bw log for every IO that completes. When writing to the
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
struct io_log *log = agg_io_log[i];
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
struct io_log *log = agg_io_log[i];
o->block_error_hist = le32_to_cpu(top->block_error_hist);
o->replay_align = le32_to_cpu(top->replay_align);
o->replay_scale = le32_to_cpu(top->replay_scale);
o->block_error_hist = le32_to_cpu(top->block_error_hist);
o->replay_align = le32_to_cpu(top->replay_align);
o->replay_scale = le32_to_cpu(top->replay_scale);
+ o->per_job_logs = le32_to_cpu(top->per_job_logs);
o->trim_backlog = le64_to_cpu(top->trim_backlog);
o->trim_backlog = le64_to_cpu(top->trim_backlog);
top->skip_bad = cpu_to_le32(o->skip_bad);
top->replay_align = cpu_to_le32(o->replay_align);
top->replay_scale = cpu_to_le32(o->replay_scale);
top->skip_bad = cpu_to_le32(o->skip_bad);
top->replay_align = cpu_to_le32(o->replay_align);
top->replay_scale = cpu_to_le32(o->replay_scale);
+ top->per_job_logs = cpu_to_le32(o->per_job_logs);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
top->bs[i] = cpu_to_le32(o->bs[i]);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
top->bs[i] = cpu_to_le32(o->bs[i]);
.BI replay_scale \fR=\fPint
Scale sector offsets down by this factor when replaying traces.
.TP
.BI replay_scale \fR=\fPint
Scale sector offsets down by this factor when replaying traces.
.TP
+.BI per_job_logs \fR=\fPbool
+If set, this generates bw/clat/iops log with per file private filenames. If
+not set, jobs with identical names will share the log filename. Default: true.
+.TP
.BI write_bw_log \fR=\fPstr
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. See \fBwrite_lat_log\fR for behaviour of given filename. For this
option, the postfix is _bw.x.log, where x is the index of the job (1..N,
.BI write_bw_log \fR=\fPstr
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. See \fBwrite_lat_log\fR for behaviour of given filename. For this
option, the postfix is _bw.x.log, where x is the index of the job (1..N,
-where N is the number of jobs)
+where N is the number of jobs). If \fBper_job_logs\fR is false, then the
+filename will not include the job index.
.TP
.BI write_lat_log \fR=\fPstr
Same as \fBwrite_bw_log\fR, but writes I/O completion latencies. If no
filename is given with this option, the default filename of
"jobname_type.x.log" is used, where x is the index of the job (1..N, where
N is the number of jobs). Even if the filename is given, fio will still
.TP
.BI write_lat_log \fR=\fPstr
Same as \fBwrite_bw_log\fR, but writes I/O completion latencies. If no
filename is given with this option, the default filename of
"jobname_type.x.log" is used, where x is the index of the job (1..N, where
N is the number of jobs). Even if the filename is given, fio will still
+append the type of log. If \fBper_job_logs\fR is false, then the filename will
+not include the job index.
.TP
.BI write_iops_log \fR=\fPstr
Same as \fBwrite_bw_log\fR, but writes IOPS. If no filename is given with this
option, the default filename of "jobname_type.x.log" is used, where x is the
index of the job (1..N, where N is the number of jobs). Even if the filename
.TP
.BI write_iops_log \fR=\fPstr
Same as \fBwrite_bw_log\fR, but writes IOPS. If no filename is given with this
option, the default filename of "jobname_type.x.log" is used, where x is the
index of the job (1..N, where N is the number of jobs). Even if the filename
-is given, fio will still append the type of log.
+is given, fio will still append the type of log. If \fBper_job_logs\fR is false,
+then the filename will not include the job index.
.TP
.BI log_avg_msec \fR=\fPint
By default, fio will log an entry in the iops, latency, or bw log for every
.TP
.BI log_avg_msec \fR=\fPint
By default, fio will log an entry in the iops, latency, or bw log for every
return dump_cmdline || parse_only;
}
return dump_cmdline || parse_only;
}
+static void gen_log_name(char *name, size_t size, const char *logtype,
+ const char *logname, unsigned int num,
+ const char *suf, int per_job)
+{
+ if (per_job)
+ snprintf(name, size, "%s_%s.%d.%s", logname, logtype, num, suf);
+ else
+ snprintf(name, size, "%s_%s.%s", logname, logtype, suf);
+}
+
/*
* Adds a job to the list of things todo. Sanitizes the various options
* to make sure we don't have conflicts, and initializes various
/*
* Adds a job to the list of things todo. Sanitizes the various options
* to make sure we don't have conflicts, and initializes various
- snprintf(logname, sizeof(logname), "%s_lat.%d.%s",
- o->lat_log_file, td->thread_number, suf);
+ gen_log_name(logname, sizeof(logname), "lat", o->lat_log_file,
+ td->thread_number, suf, o->per_job_logs);
setup_log(&td->lat_log, &p, logname);
setup_log(&td->lat_log, &p, logname);
- snprintf(logname, sizeof(logname), "%s_slat.%d.%s",
- o->lat_log_file, td->thread_number, suf);
+
+ gen_log_name(logname, sizeof(logname), "slat", o->lat_log_file,
+ td->thread_number, suf, o->per_job_logs);
setup_log(&td->slat_log, &p, logname);
setup_log(&td->slat_log, &p, logname);
- snprintf(logname, sizeof(logname), "%s_clat.%d.%s",
- o->lat_log_file, td->thread_number, suf);
+
+ gen_log_name(logname, sizeof(logname), "clat", o->lat_log_file,
+ td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_log, &p, logname);
}
if (o->bw_log_file) {
setup_log(&td->clat_log, &p, logname);
}
if (o->bw_log_file) {
- snprintf(logname, sizeof(logname), "%s_bw.%d.%s",
- o->bw_log_file, td->thread_number, suf);
+ gen_log_name(logname, sizeof(logname), "bw", o->bw_log_file,
+ td->thread_number, suf, o->per_job_logs);
setup_log(&td->bw_log, &p, logname);
}
if (o->iops_log_file) {
setup_log(&td->bw_log, &p, logname);
}
if (o->iops_log_file) {
- snprintf(logname, sizeof(logname), "%s_iops.%d.%s",
- o->iops_log_file, td->thread_number, suf);
+ gen_log_name(logname, sizeof(logname), "iops", o->iops_log_file,
+ td->thread_number, suf, o->per_job_logs);
setup_log(&td->iops_log, &p, logname);
}
setup_log(&td->iops_log, &p, logname);
}
-void flush_log(struct io_log *log)
+void flush_log(struct io_log *log, int do_append)
- f = fopen(log->filename, "w");
+ if (!do_append)
+ f = fopen(log->filename, "w");
+ else
+ f = fopen(log->filename, "a");
if (!f) {
perror("fopen log");
return;
if (!f) {
perror("fopen log");
return;
if (td->client_type == FIO_CLIENT_TYPE_GUI)
fio_send_iolog(td, log, log->filename);
else
if (td->client_type == FIO_CLIENT_TYPE_GUI)
fio_send_iolog(td, log, log->filename);
else
+ flush_log(log, !td->o.per_job_logs);
fio_unlock_file(log->filename);
free_log(log);
fio_unlock_file(log->filename);
free_log(log);
extern void init_disk_util(struct thread_data *);
extern void update_rusage_stat(struct thread_data *);
extern void setup_log(struct io_log **, struct log_params *, const char *);
extern void init_disk_util(struct thread_data *);
extern void update_rusage_stat(struct thread_data *);
extern void setup_log(struct io_log **, struct log_params *, const char *);
-extern void flush_log(struct io_log *);
+extern void flush_log(struct io_log *, int);
extern void free_log(struct io_log *);
extern struct io_log *agg_io_log[DDIR_RWDIR_CNT];
extern int write_bw_log;
extern void free_log(struct io_log *);
extern struct io_log *agg_io_log[DDIR_RWDIR_CNT];
extern int write_bw_log;
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_PROCESS,
},
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_PROCESS,
},
+ {
+ .name = "per_job_logs",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(per_job_logs),
+ .help = "Include job number in generated log files or not",
+ .def = "1",
+ .category = FIO_OPT_C_LOG,
+ .group = FIO_OPT_G_INVALID,
+ },
{
.name = "write_bw_log",
.lname = "Write bandwidth log",
{
.name = "write_bw_log",
.lname = "Write bandwidth log",
unsigned int replay_align;
unsigned int replay_scale;
unsigned int replay_align;
unsigned int replay_scale;
+
+ unsigned int per_job_logs;
};
#define FIO_TOP_STR_MAX 256
};
#define FIO_TOP_STR_MAX 256
uint32_t replay_align;
uint32_t replay_scale;
uint32_t replay_align;
uint32_t replay_scale;
+
+ uint32_t per_job_logs;
} __attribute__((packed));
extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
} __attribute__((packed));
extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);