projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1612c4a
)
steadystate: check for division by zero in mean calculation
author
Jens Axboe
<axboe@kernel.dk>
Sun, 8 Apr 2018 21:54:26 +0000
(15:54 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Sun, 8 Apr 2018 21:54:26 +0000
(15:54 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
steadystate.c
patch
|
blob
|
blame
|
history
diff --git
a/steadystate.c
b/steadystate.c
index 1e3a546896ad8b1379368019272ba3ab11b6284f..ee1c0e5b637d0512302ea96fb4e7f9263a4c5799 100644
(file)
--- a/
steadystate.c
+++ b/
steadystate.c
@@
-350,6
+350,9
@@
uint64_t steadystate_bw_mean(struct thread_stat *ts)
int i;
uint64_t sum;
+ if (!ts->ss_dur)
+ return 0;
+
for (i = 0, sum = 0; i < ts->ss_dur; i++)
sum += ts->ss_bw_data[i];
@@
-361,6
+364,9
@@
uint64_t steadystate_iops_mean(struct thread_stat *ts)
int i;
uint64_t sum;
+ if (!ts->ss_dur)
+ return 0;
+
for (i = 0, sum = 0; i < ts->ss_dur; i++)
sum += ts->ss_iops_data[i];