Lines Matching refs:iolog
1978 static struct io_logs *get_new_log(struct io_log *iolog) in get_new_log() argument
1987 if (!iolog->cur_log_max) in get_new_log()
1990 new_samples = iolog->cur_log_max * 2; in get_new_log()
1995 new_size = new_samples * log_entry_sz(iolog); in get_new_log()
2004 flist_add_tail(&cur_log->list, &iolog->io_logs); in get_new_log()
2005 iolog->cur_log_max = new_samples; in get_new_log()
2017 static struct io_logs *regrow_log(struct io_log *iolog) in regrow_log() argument
2022 if (!iolog || iolog->disabled) in regrow_log()
2025 cur_log = iolog_cur_log(iolog); in regrow_log()
2027 cur_log = get_new_log(iolog); in regrow_log()
2039 if (iolog->log_gz) { in regrow_log()
2040 if (iolog_cur_flush(iolog, cur_log)) { in regrow_log()
2049 cur_log = get_new_log(iolog); in regrow_log()
2055 if (!iolog->pending || !iolog->pending->nr_samples) in regrow_log()
2061 for (i = 0; i < iolog->pending->nr_samples; i++) { in regrow_log()
2064 src = get_sample(iolog, iolog->pending, i); in regrow_log()
2065 dst = get_sample(iolog, cur_log, i); in regrow_log()
2066 memcpy(dst, src, log_entry_sz(iolog)); in regrow_log()
2068 cur_log->nr_samples = iolog->pending->nr_samples; in regrow_log()
2070 iolog->pending->nr_samples = 0; in regrow_log()
2073 if (iolog) in regrow_log()
2074 iolog->disabled = true; in regrow_log()
2089 static struct io_logs *get_cur_log(struct io_log *iolog) in get_cur_log() argument
2093 cur_log = iolog_cur_log(iolog); in get_cur_log()
2095 cur_log = get_new_log(iolog); in get_cur_log()
2110 if (iolog->td->o.io_submit_mode == IO_MODE_OFFLOAD || in get_cur_log()
2111 !per_unit_log(iolog)) in get_cur_log()
2112 return regrow_log(iolog); in get_cur_log()
2114 iolog->td->flags |= TD_F_REGROW_LOGS; in get_cur_log()
2115 assert(iolog->pending->nr_samples < iolog->pending->max_samples); in get_cur_log()
2116 return iolog->pending; in get_cur_log()
2119 static void __add_log_sample(struct io_log *iolog, union io_sample_data data, in __add_log_sample() argument
2125 if (iolog->disabled) in __add_log_sample()
2127 if (flist_empty(&iolog->io_logs)) in __add_log_sample()
2128 iolog->avg_last = t; in __add_log_sample()
2130 cur_log = get_cur_log(iolog); in __add_log_sample()
2134 s = get_sample(iolog, cur_log, cur_log->nr_samples); in __add_log_sample()
2137 s->time = t + (iolog->td ? iolog->td->unix_epoch : 0); in __add_log_sample()
2138 io_sample_set_ddir(iolog, s, ddir); in __add_log_sample()
2141 if (iolog->log_offset) { in __add_log_sample()
2151 iolog->disabled = true; in __add_log_sample()
2197 static void __add_stat_to_log(struct io_log *iolog, enum fio_ddir ddir, in __add_stat_to_log() argument
2205 if (iolog->avg_window[ddir].samples) { in __add_stat_to_log()
2209 data.val = iolog->avg_window[ddir].max_val; in __add_stat_to_log()
2211 data.val = iolog->avg_window[ddir].mean.u.f + 0.50; in __add_stat_to_log()
2213 __add_log_sample(iolog, data, ddir, 0, elapsed, 0); in __add_stat_to_log()
2216 reset_io_stat(&iolog->avg_window[ddir]); in __add_stat_to_log()
2219 static void _add_stat_to_log(struct io_log *iolog, unsigned long elapsed, in _add_stat_to_log() argument
2225 __add_stat_to_log(iolog, ddir, elapsed, log_max); in _add_stat_to_log()
2228 static long add_log_sample(struct thread_data *td, struct io_log *iolog, in add_log_sample() argument
2242 if (!iolog->avg_msec) { in add_log_sample()
2243 __add_log_sample(iolog, data, ddir, bs, elapsed, offset); in add_log_sample()
2251 add_stat_sample(&iolog->avg_window[ddir], data.val); in add_log_sample()
2257 this_window = elapsed - iolog->avg_last; in add_log_sample()
2258 if (elapsed < iolog->avg_last) in add_log_sample()
2259 return iolog->avg_last - elapsed; in add_log_sample()
2260 else if (this_window < iolog->avg_msec) { in add_log_sample()
2261 int diff = iolog->avg_msec - this_window; in add_log_sample()
2263 if (inline_log(iolog) || diff > LOG_MSEC_SLACK) in add_log_sample()
2267 _add_stat_to_log(iolog, elapsed, td->o.log_max != 0); in add_log_sample()
2269 iolog->avg_last = elapsed - (this_window - iolog->avg_msec); in add_log_sample()
2270 return iolog->avg_msec; in add_log_sample()
2293 struct io_log *iolog; in add_agg_sample() local
2298 iolog = agg_io_log[ddir]; in add_agg_sample()
2299 __add_log_sample(iolog, data, ddir, bs, mtime_since_genesis(), 0); in add_agg_sample()
2316 struct io_log *iolog = td->clat_hist_log; in add_clat_sample() local
2329 if (iolog && iolog->hist_msec) { in add_clat_sample()
2330 struct io_hist *hw = &iolog->hist_window[ddir]; in add_clat_sample()
2338 if (this_window >= iolog->hist_msec) { in add_clat_sample()
2354 __add_log_sample(iolog, sample_plat(dst), ddir, bs, in add_clat_sample()
2362 hw->hist_last = elapsed - (this_window - iolog->hist_msec); in add_clat_sample()