nvme/perf: fix alignment of final data

The core number may be 1 or 2 characters, and the
printf format wasn't accounting for that.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3c87466df1014fb6c0a4e7db1a9b6f6054559eae

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473065
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Jim Harris 2019-11-01 09:32:42 -07:00 committed by Tomasz Zawadzki
parent 766ef001f3
commit 2a8dc3e943

View File

@ -1204,7 +1204,7 @@ print_performance(void)
printf("========================================================\n");
printf("%*s\n", max_strlen + 60, "Latency(us)");
printf("%-*s: %10s %10s %10s %10s %10s\n",
max_strlen + 12, "Device Information", "IOPS", "MiB/s", "Average", "min", "max");
max_strlen + 13, "Device Information", "IOPS", "MiB/s", "Average", "min", "max");
worker = g_workers;
while (worker) {
@ -1224,7 +1224,7 @@ print_performance(void)
max_latency_so_far = max_latency;
}
printf("%-*.*s from core %u: %10.2f %10.2f %10.2f %10.2f %10.2f\n",
printf("%-*.*s from core %2u: %10.2f %10.2f %10.2f %10.2f %10.2f\n",
max_strlen, max_strlen, ns_ctx->entry->name, worker->lcore,
io_per_second, mb_per_second,
average_latency, min_latency, max_latency);
@ -1243,7 +1243,7 @@ print_performance(void)
sum_ave_latency = ((double)total_io_tsc / total_io_completed) * 1000 * 1000 / g_tsc_rate;
printf("========================================================\n");
printf("%-*s: %10.2f %10.2f %10.2f %10.2f %10.2f\n",
max_strlen + 12, "Total", total_io_per_second, total_mb_per_second,
max_strlen + 13, "Total", total_io_per_second, total_mb_per_second,
sum_ave_latency, min_latency_so_far, max_latency_so_far);
printf("\n");
}