projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
476882d
)
idletime: fix potential divide-by-zero
author
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 15:47:14 +0000
(09:47 -0600)
committer
Jens Axboe
<axboe@fb.com>
Mon, 14 Apr 2014 15:47:14 +0000
(09:47 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
idletime.c
patch
|
blob
|
blame
|
history
diff --git
a/idletime.c
b/idletime.c
index c0bc0bfce19675e311fcbd7394540b02a7010eba..bc8097680d69f37b139495b61f56287b588c9693 100644
(file)
--- a/
idletime.c
+++ b/
idletime.c
@@
-336,7
+336,10
@@
void fio_idle_prof_stop(void)
/* calculate idleness */
if (ipc.cali_mean != 0.0) {
runt = utime_since(&ipt->tps, &ipt->tpe);
- ipt->idleness = ipt->loops * ipc.cali_mean / runt;
+ if (runt)
+ ipt->idleness = ipt->loops * ipc.cali_mean / runt;
+ else
+ ipt->idleness = 0.0;
} else
ipt->idleness = 0.0;
}