bdevperf: replace floats with doubles
Use double-precision floating point in the performance_dump() function, since we can be dealing with large numbers (especially now that io_completed is now uint64_t). This isn't part of the I/O path, just used to print statistics, so there should be no performance impact. Also, the arguments passed to printf() were already implicitly being promoted to double, so this actually removes an extra conversion step. Change-Id: I12aae36bc42e83777eaa050561eb5e55060ae81c Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/392414 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
233c5189ab
commit
1fe9ba9dba
@ -548,8 +548,8 @@ performance_dump(int io_time_in_usec)
|
||||
{
|
||||
uint32_t index;
|
||||
unsigned lcore_id;
|
||||
float io_per_second, mb_per_second;
|
||||
float total_io_per_second, total_mb_per_second;
|
||||
double io_per_second, mb_per_second;
|
||||
double total_io_per_second, total_mb_per_second;
|
||||
struct io_target *target;
|
||||
|
||||
total_io_per_second = 0;
|
||||
@ -561,7 +561,7 @@ performance_dump(int io_time_in_usec)
|
||||
printf("\r Logical core: %u\n", lcore_id);
|
||||
}
|
||||
while (target != NULL) {
|
||||
io_per_second = (float)target->io_completed * 1000000 /
|
||||
io_per_second = (double)target->io_completed * 1000000 /
|
||||
io_time_in_usec;
|
||||
mb_per_second = io_per_second * g_io_size /
|
||||
(1024 * 1024);
|
||||
|
Loading…
Reference in New Issue
Block a user