xenbaked.c -> dump_stats(), run_time = time(&end_time) - time(&start_time),
time() returns the value in seconds. If one cancels xenmon.py immediately
after started, run_time can be zero, and then xenbaked will hit divide by
zero fault.
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
}
printf("processed %d total records in %d seconds (%ld per second)\n",
- rec_count, (int)run_time, (long)(rec_count/run_time));
+ rec_count, (int)run_time,
+ run_time ? (long)(rec_count/run_time) : 0L);
- printf("woke up %d times in %d seconds (%ld per second)\n", wakeups,
- (int) run_time, (long)(wakeups/run_time));
+ printf("woke up %d times in %d seconds (%ld per second)\n",
+ wakeups, (int) run_time,
+ run_time ? (long)(wakeups/run_time) : 0L);
check_gotten_sum();
}