diff mbox series

[v2,2/7] test/hash: more accurate hash perf test output

Message ID 1537550255-252066-3-git-send-email-yipeng1.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series hash: add extendable bucket and partial key hashing | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Wang, Yipeng1 Sept. 21, 2018, 5:17 p.m. UTC
Edit the printf information when error happens to be more
accurate and informative.

Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 test/test/test_hash_perf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Bruce Richardson Sept. 26, 2018, 10:07 a.m. UTC | #1
On Fri, Sep 21, 2018 at 10:17:30AM -0700, Yipeng Wang wrote:
> Edit the printf information when error happens to be more
> accurate and informative.
> 
> Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
diff mbox series

Patch

diff --git a/test/test/test_hash_perf.c b/test/test/test_hash_perf.c
index 9ed7125..4d00c20 100644
--- a/test/test/test_hash_perf.c
+++ b/test/test/test_hash_perf.c
@@ -248,7 +248,7 @@  timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
 						(const void *) keys[i],
 						signatures[i], data);
 			if (ret < 0) {
-				printf("Failed to add key number %u\n", ret);
+				printf("H+D: Failed to add key number %u\n", i);
 				return -1;
 			}
 		} else if (with_hash && !with_data) {
@@ -258,7 +258,7 @@  timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
 			if (ret >= 0)
 				positions[i] = ret;
 			else {
-				printf("Failed to add key number %u\n", ret);
+				printf("H: Failed to add key number %u\n", i);
 				return -1;
 			}
 		} else if (!with_hash && with_data) {
@@ -266,7 +266,7 @@  timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
 						(const void *) keys[i],
 						data);
 			if (ret < 0) {
-				printf("Failed to add key number %u\n", ret);
+				printf("D: Failed to add key number %u\n", i);
 				return -1;
 			}
 		} else {
@@ -274,7 +274,7 @@  timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
 			if (ret >= 0)
 				positions[i] = ret;
 			else {
-				printf("Failed to add key number %u\n", ret);
+				printf("Failed to add key number %u\n", i);
 				return -1;
 			}
 		}
@@ -442,7 +442,7 @@  timed_deletes(unsigned with_hash, unsigned with_data, unsigned table_index)
 		if (ret >= 0)
 			positions[i] = ret;
 		else {
-			printf("Failed to add key number %u\n", ret);
+			printf("Failed to delete key number %u\n", i);
 			return -1;
 		}
 	}