spdk: show total performance result in the ioat_kperf tool

Change-Id: I68010590988fb3e1314922501e45381a029fb9f6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Changpeng Liu 2016-01-19 17:31:02 +08:00 committed by Daniel Verkamp
parent a7c6c3cc18
commit 0021c23dfe
2 changed files with 10 additions and 1 deletions

View File

@ -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
==========

View File

@ -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;
}