A previous commit inadvertently used ramp_time_over() instead of
in_ramp_time(), which breaks some jobs with ramp time. This is
because the former function has side effects, where we really
just want to check if we're in ramp time or not.
Fixes:
a47591e4923f ("Improve logging accuracy")
Signed-off-by: Jens Axboe <axboe@fb.com>
#ifndef FIO_TIME_H
#define FIO_TIME_H
+#include "lib/types.h"
+
struct thread_data;
extern uint64_t utime_since(const struct timeval *,const struct timeval *);
extern uint64_t utime_since_now(const struct timeval *);
extern uint64_t usec_sleep(struct thread_data *, unsigned long);
extern void fill_start_time(struct timeval *);
extern void set_genesis_time(void);
-extern int ramp_time_over(struct thread_data *);
-extern int in_ramp_time(struct thread_data *);
+extern bool ramp_time_over(struct thread_data *);
+extern bool in_ramp_time(struct thread_data *);
extern void fio_time_init(void);
extern void timeval_add_msec(struct timeval *, unsigned int);
fio_gettime(&now, NULL);
for_each_td(td, i) {
- if (!ramp_time_over(td) ||
+ if (!in_ramp_time(td) ||
!(td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING)) {
next = min(td->o.iops_avg_time, td->o.bw_avg_time);
continue;
return utime_since_now(&genesis);
}
-int in_ramp_time(struct thread_data *td)
+bool in_ramp_time(struct thread_data *td)
{
return td->o.ramp_time && !td->ramp_time_over;
}
td_set_runstate(parent, TD_RAMP);
}
-int ramp_time_over(struct thread_data *td)
+bool ramp_time_over(struct thread_data *td)
{
struct timeval tv;
if (!td->o.ramp_time || td->ramp_time_over)
- return 1;
+ return true;
fio_gettime(&tv, NULL);
if (utime_since(&td->epoch, &tv) >= td->o.ramp_time) {
reset_all_stats(td);
td_set_runstate(td, TD_RAMP);
parent_update_ramp(td);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
void fio_time_init(void)