lib/rand: cleanup __fill_random_buffer()
[fio.git] / t / btrace2fio.c
index bf67ed0a183ac5cbd08854087e068f37355d399b..04d4a28dd2ccfd8ca85496e6a17dd6724573082c 100644 (file)
@@ -365,8 +365,6 @@ static int handle_trace(struct blk_io_trace *t, struct btrace_pid *p)
        if (act == __BLK_TA_QUEUE) {
                inflight_add(p, t->sector, t->bytes);
                ret = handle_queue_trace(t, p);
-       } else if (act == __BLK_TA_REQUEUE) {
-               p->o.inflight--;
        } else if (act == __BLK_TA_BACKMERGE) {
                struct inflight *i;
 
@@ -546,11 +544,15 @@ static unsigned long o_to_kb_rate(struct btrace_out *o, int rw)
        uint64_t usec = (o->last_ttime[rw] - o->first_ttime[rw]) / 1000ULL;
        uint64_t val;
 
+       if (!usec)
+               return 0;
+
+       usec /= 1000;
        if (!usec)
                return 0;
 
        val = o->kb[rw] * 1000ULL;
-       return val / (usec / 1000ULL);
+       return val / usec;
 }
 
 static uint64_t o_first_ttime(struct btrace_out *o)