Lines Matching defs:iolog
1567 static void __add_log_sample(struct io_log *iolog, unsigned long val,
1571 uint64_t nr_samples = iolog->nr_samples;
1574 if (iolog->disabled)
1577 if (!iolog->nr_samples)
1578 iolog->avg_last = t;
1580 if (iolog->nr_samples == iolog->max_samples) {
1584 new_size = 2 * iolog->max_samples * log_entry_sz(iolog);
1586 if (iolog->log_gz && (new_size > iolog->log_gz)) {
1587 if (iolog_flush(iolog, 0)) {
1588 log_err("fio: failed flushing iolog! Will stop logging.\n");
1589 iolog->disabled = 1;
1592 nr_samples = iolog->nr_samples;
1594 new_log = realloc(iolog->log, new_size);
1596 log_err("fio: failed extending iolog! Will stop logging.\n");
1597 iolog->disabled = 1;
1600 iolog->log = new_log;
1601 iolog->max_samples <<= 1;
1605 s = get_sample(iolog, nr_samples);
1609 io_sample_set_ddir(iolog, s, ddir);
1612 if (iolog->log_offset) {
1618 iolog->nr_samples++;
1663 static void _add_stat_to_log(struct io_log *iolog, unsigned long elapsed)
1670 if (iolog->avg_window[DDIR_READ].samples) {
1673 mr = iolog->avg_window[DDIR_READ].mean.u.f + 0.50;
1674 __add_log_sample(iolog, mr, DDIR_READ, 0, elapsed, 0);
1676 if (iolog->avg_window[DDIR_WRITE].samples) {
1679 mw = iolog->avg_window[DDIR_WRITE].mean.u.f + 0.50;
1680 __add_log_sample(iolog, mw, DDIR_WRITE, 0, elapsed, 0);
1682 if (iolog->avg_window[DDIR_TRIM].samples) {
1685 mw = iolog->avg_window[DDIR_TRIM].mean.u.f + 0.50;
1686 __add_log_sample(iolog, mw, DDIR_TRIM, 0, elapsed, 0);
1689 reset_io_stat(&iolog->avg_window[DDIR_READ]);
1690 reset_io_stat(&iolog->avg_window[DDIR_WRITE]);
1691 reset_io_stat(&iolog->avg_window[DDIR_TRIM]);
1694 static void add_log_sample(struct thread_data *td, struct io_log *iolog,
1708 if (!iolog->avg_msec) {
1709 __add_log_sample(iolog, val, ddir, bs, elapsed, offset);
1717 add_stat_sample(&iolog->avg_window[ddir], val);
1723 this_window = elapsed - iolog->avg_last;
1724 if (this_window < iolog->avg_msec)
1727 _add_stat_to_log(iolog, elapsed);
1729 iolog->avg_last = elapsed;
1752 struct io_log *iolog;
1757 iolog = agg_io_log[ddir];
1758 __add_log_sample(iolog, val, ddir, bs, mtime_since_genesis(), 0);