From 0021c23dfef7ee2d687389142dc7f884b37fdf49 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 19 Jan 2016 17:31:02 +0800 Subject: [PATCH] spdk: show total performance result in the ioat_kperf tool Change-Id: I68010590988fb3e1314922501e45381a029fb9f6 Signed-off-by: Changpeng Liu --- examples/ioat/kperf/README | 1 + examples/ioat/kperf/ioat_kperf.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/ioat/kperf/README b/examples/ioat/kperf/README index 61bb8e153..cf1e3aa12 100644 --- a/examples/ioat/kperf/README +++ b/examples/ioat/kperf/README @@ -35,6 +35,7 @@ Building & Usage Channel 1 Performance Data 1413 MB/s Channel 2 Performance Data 1413 MB/s Channel 3 Performance Data 1415 MB/s + Total Channel Performance Data 5655 MB/s OS Support ========== diff --git a/examples/ioat/kperf/ioat_kperf.c b/examples/ioat/kperf/ioat_kperf.c index fd2196626..5cf0a5cd5 100644 --- a/examples/ioat/kperf/ioat_kperf.c +++ b/examples/ioat/kperf/ioat_kperf.c @@ -194,6 +194,8 @@ int main(int argc, char *argv[]) uint32_t transfer_size, order = 0; uint64_t total_size, copied = 0; uint64_t elapsed_time = 0; + uint64_t total_time = 0; + uint64_t perf, total_copied = 0; char channel[1024]; if (check_modules("ioatdma")) { @@ -346,9 +348,15 @@ int main(int argc, char *argv[]) return -1; } assert(elapsed_time != 0); + perf = copied / elapsed_time; + total_copied += copied; + total_time += elapsed_time; fprintf(stdout, "Channel %d Performance Data %"PRIu64" MB/s\n", - i, copied / elapsed_time); + i, perf); } + if (total_time && threads) + fprintf(stdout, "Total Channel Performance Data %"PRIu64" MB/s\n", + total_copied / total_time / threads); return 0; }