Clear rusage stat when resetting all stats
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index da3ad2a22412dcadba647e7b5cee0250e6cfdec9..e5ec22374b8c2d410fdfa1e841ba93c0ad8ecd08 100644 (file)
--- a/stat.c
+++ b/stat.c
 
 struct fio_mutex *stat_mutex;
 
+void clear_rusage_stat(struct thread_data *td)
+{
+       struct thread_stat *ts = &td->ts;
+
+       fio_getrusage(&td->ru_start);
+       ts->usr_time = ts->sys_time = 0;
+       ts->ctx = 0;
+       ts->minf = ts->majf = 0;
+}
+
 void update_rusage_stat(struct thread_data *td)
 {
        struct thread_stat *ts = &td->ts;