if (write_bw_log && rate_time > bw_avg_time && !in_ramp_time(td)) {
calc_rate(rate_time, io_bytes, rate_io_bytes, rate);
memcpy(&rate_prev_time, &now, sizeof(now));
- add_agg_sample(rate[DDIR_READ], DDIR_READ);
- add_agg_sample(rate[DDIR_WRITE], DDIR_WRITE);
+ add_agg_sample(rate[DDIR_READ], DDIR_READ, 0);
+ add_agg_sample(rate[DDIR_WRITE], DDIR_WRITE, 0);
}
disp_time = mtime_since(&disp_prev_time, &now);
unsigned long time;
unsigned long val;
enum fio_ddir ddir;
+ unsigned int bs;
};
/*
/*
* Logging
*/
-extern void add_clat_sample(struct thread_data *, enum fio_ddir, unsigned long);
-extern void add_slat_sample(struct thread_data *, enum fio_ddir, unsigned long);
-extern void add_bw_sample(struct thread_data *, enum fio_ddir, struct timeval *);
+extern void add_clat_sample(struct thread_data *, enum fio_ddir, unsigned long,
+ unsigned int);
+extern void add_slat_sample(struct thread_data *, enum fio_ddir, unsigned long,
+ unsigned int);
+extern void add_bw_sample(struct thread_data *, enum fio_ddir, unsigned int,
+ struct timeval *);
extern void show_run_stats(void);
extern void init_disk_util(struct thread_data *);
extern void update_rusage_stat(struct thread_data *);
extern void __finish_log(struct io_log *, const char *);
extern struct io_log *agg_io_log[2];
extern int write_bw_log;
-extern void add_agg_sample(unsigned long, enum fio_ddir);
+extern void add_agg_sample(unsigned long, enum fio_ddir, unsigned int);
/*
* Time functions
&icd->time);
if (!td->o.disable_clat) {
- add_clat_sample(td, idx, usec);
+ add_clat_sample(td, idx, usec, bytes);
io_u_mark_latency(td, usec);
}
if (!td->o.disable_bw)
- add_bw_sample(td, idx, &icd->time);
+ add_bw_sample(td, idx, bytes, &icd->time);
}
if (td_write(td) && idx == DDIR_WRITE &&
unsigned long slat_time;
slat_time = utime_since(&io_u->start_time, &io_u->issue_time);
- add_slat_sample(td, io_u->ddir, slat_time);
+ add_slat_sample(td, io_u->ddir, io_u->xfer_buflen, slat_time);
}
}
}
static void __add_log_sample(struct io_log *iolog, unsigned long val,
- enum fio_ddir ddir, unsigned long time)
+ enum fio_ddir ddir, unsigned int bs,
+ unsigned long time)
{
+ const int nr_samples = iolog->nr_samples;
+
if (iolog->nr_samples == iolog->max_samples) {
int new_size = sizeof(struct io_sample) * iolog->max_samples*2;
iolog->max_samples <<= 1;
}
- iolog->log[iolog->nr_samples].val = val;
- iolog->log[iolog->nr_samples].time = time;
- iolog->log[iolog->nr_samples].ddir = ddir;
+ iolog->log[nr_samples].val = val;
+ iolog->log[nr_samples].time = time;
+ iolog->log[nr_samples].ddir = ddir;
+ iolog->log[nr_samples].bs = bs;
iolog->nr_samples++;
}
static void add_log_sample(struct thread_data *td, struct io_log *iolog,
- unsigned long val, enum fio_ddir ddir)
+ unsigned long val, enum fio_ddir ddir,
+ unsigned int bs)
{
- __add_log_sample(iolog, val, ddir, mtime_since_now(&td->epoch));
+ __add_log_sample(iolog, val, ddir, bs, mtime_since_now(&td->epoch));
}
-void add_agg_sample(unsigned long val, enum fio_ddir ddir)
+void add_agg_sample(unsigned long val, enum fio_ddir ddir, unsigned int bs)
{
struct io_log *iolog = agg_io_log[ddir];
- __add_log_sample(iolog, val, ddir, mtime_since_genesis());
+ __add_log_sample(iolog, val, ddir, bs, mtime_since_genesis());
}
void add_clat_sample(struct thread_data *td, enum fio_ddir ddir,
- unsigned long usec)
+ unsigned long usec, unsigned int bs)
{
struct thread_stat *ts = &td->ts;
add_stat_sample(&ts->clat_stat[ddir], usec);
if (ts->clat_log)
- add_log_sample(td, ts->clat_log, usec, ddir);
+ add_log_sample(td, ts->clat_log, usec, ddir, bs);
}
void add_slat_sample(struct thread_data *td, enum fio_ddir ddir,
- unsigned long usec)
+ unsigned long usec, unsigned int bs)
{
struct thread_stat *ts = &td->ts;
add_stat_sample(&ts->slat_stat[ddir], usec);
if (ts->slat_log)
- add_log_sample(td, ts->slat_log, usec, ddir);
+ add_log_sample(td, ts->slat_log, usec, ddir, bs);
}
-void add_bw_sample(struct thread_data *td, enum fio_ddir ddir,
+void add_bw_sample(struct thread_data *td, enum fio_ddir ddir, unsigned int bs,
struct timeval *t)
{
struct thread_stat *ts = &td->ts;
add_stat_sample(&ts->bw_stat[ddir], rate);
if (ts->bw_log)
- add_log_sample(td, ts->bw_log, rate, ddir);
+ add_log_sample(td, ts->bw_log, rate, ddir, bs);
fio_gettime(&ts->stat_sample_time[ddir], NULL);
ts->stat_io_bytes[ddir] = td->this_io_bytes[ddir];