iolog: note type of log
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/backend.c b/backend.c
index 7343286..7149c11 100644
--- a/backend.c
+++ b/backend.c
@@ -1623,8 +1623,8 @@
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_READ], 0, IO_LOG_TYPE_BW);
+ setup_log(&agg_io_log[DDIR_WRITE], 0, IO_LOG_TYPE_BW);
}
startup_mutex = fio_mutex_init(0);
diff --git a/init.c b/init.c
index 61b3d4b..820c30c 100644
--- a/init.c
+++ b/init.c
@@ -846,14 +846,14 @@
goto err;
if (td->o.write_lat_log) {
- setup_log(&td->lat_log, td->o.log_avg_msec);
- setup_log(&td->slat_log, td->o.log_avg_msec);
- setup_log(&td->clat_log, td->o.log_avg_msec);
+ setup_log(&td->lat_log, td->o.log_avg_msec, IO_LOG_TYPE_LAT);
+ setup_log(&td->slat_log, td->o.log_avg_msec, IO_LOG_TYPE_SLAT);
+ setup_log(&td->clat_log, td->o.log_avg_msec, IO_LOG_TYPE_CLAT);
}
if (td->o.write_bw_log)
- setup_log(&td->bw_log, td->o.log_avg_msec);
+ setup_log(&td->bw_log, td->o.log_avg_msec, IO_LOG_TYPE_BW);
if (td->o.write_iops_log)
- setup_log(&td->iops_log, td->o.log_avg_msec);
+ setup_log(&td->iops_log, td->o.log_avg_msec, IO_LOG_TYPE_IOPS);
if (!td->o.name)
td->o.name = strdup(jobname);
diff --git a/iolog.c b/iolog.c
index 1d61ba2..5d7c5ab 100644
--- a/iolog.c
+++ b/iolog.c
@@ -492,13 +492,14 @@
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;
diff --git a/iolog.h b/iolog.h
index e790e7d..d00d00c 100644
--- a/iolog.h
+++ b/iolog.h
@@ -27,6 +27,14 @@
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
*/
@@ -38,6 +46,8 @@
unsigned long max_samples;
struct io_sample *log;
+ int log_type;
+
/*
* Windowed average, for logging single entries average over some
* period of time.
@@ -110,7 +120,7 @@
extern void init_disk_util(struct thread_data *);
extern void update_rusage_stat(struct thread_data *);
extern void update_io_ticks(void);
-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 *);