Commit 1fe9ba9d authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392414


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 233c5189
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);