return 0;
if (write_bw_log) {
- setup_log(&agg_io_log[DDIR_READ], 0);
- setup_log(&agg_io_log[DDIR_WRITE], 0);
- setup_log(&agg_io_log[DDIR_TRIM], 0);
+ setup_log(&agg_io_log[DDIR_READ], 0, IO_LOG_TYPE_BW);
+ setup_log(&agg_io_log[DDIR_WRITE], 0, IO_LOG_TYPE_BW);
+ setup_log(&agg_io_log[DDIR_TRIM], 0, IO_LOG_TYPE_BW);
}
startup_mutex = fio_mutex_init(FIO_MUTEX_LOCKED);
goto err;
if (o->write_lat_log) {
- setup_log(&td->lat_log, o->log_avg_msec);
- setup_log(&td->slat_log, o->log_avg_msec);
- setup_log(&td->clat_log, o->log_avg_msec);
+ setup_log(&td->lat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
+ setup_log(&td->slat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
+ setup_log(&td->clat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
}
if (o->write_bw_log)
- setup_log(&td->bw_log, o->log_avg_msec);
+ setup_log(&td->bw_log, o->log_avg_msec, IO_LOG_TYPE_BW);
if (o->write_iops_log)
- setup_log(&td->iops_log, o->log_avg_msec);
+ setup_log(&td->iops_log, o->log_avg_msec, IO_LOG_TYPE_IOPS);
if (!o->name)
o->name = strdup(jobname);
return ret;
}
-void setup_log(struct io_log **log, unsigned long avg_msec)
+void setup_log(struct io_log **log, unsigned long avg_msec, int log_type)
{
struct io_log *l = malloc(sizeof(*l));
memset(l, 0, sizeof(*l));
l->nr_samples = 0;
l->max_samples = 1024;
+ l->log_type = log_type;
l->log = malloc(l->max_samples * sizeof(struct io_sample));
l->avg_msec = avg_msec;
*log = l;
unsigned int bs;
};
+enum {
+ IO_LOG_TYPE_LAT = 1,
+ IO_LOG_TYPE_CLAT,
+ IO_LOG_TYPE_SLAT,
+ IO_LOG_TYPE_BW,
+ IO_LOG_TYPE_IOPS,
+};
+
/*
* Dynamically growing data sample log
*/
unsigned long max_samples;
struct io_sample *log;
+ int log_type;
+
/*
* Windowed average, for logging single entries average over some
* period of time.
extern void add_iops_sample(struct thread_data *, enum fio_ddir, struct timeval *);
extern void init_disk_util(struct thread_data *);
extern void update_rusage_stat(struct thread_data *);
-extern void setup_log(struct io_log **, unsigned long);
+extern void setup_log(struct io_log **, unsigned long, int);
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 *);