test/hash: improve accuracy of perf test output
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>
This commit is contained in:
parent
b772a15eb8
commit
0b75b8d404
@ -249,7 +249,7 @@ timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
|
|||||||
(const void *) keys[i],
|
(const void *) keys[i],
|
||||||
signatures[i], data);
|
signatures[i], data);
|
||||||
if (ret < 0) {
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (with_hash && !with_data) {
|
} else if (with_hash && !with_data) {
|
||||||
@ -259,7 +259,7 @@ timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
|
|||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
positions[i] = ret;
|
positions[i] = ret;
|
||||||
else {
|
else {
|
||||||
printf("Failed to add key number %u\n", ret);
|
printf("H: Failed to add key number %u\n", i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (!with_hash && with_data) {
|
} else if (!with_hash && with_data) {
|
||||||
@ -267,7 +267,7 @@ timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
|
|||||||
(const void *) keys[i],
|
(const void *) keys[i],
|
||||||
data);
|
data);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printf("Failed to add key number %u\n", ret);
|
printf("D: Failed to add key number %u\n", i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -275,7 +275,7 @@ timed_adds(unsigned with_hash, unsigned with_data, unsigned table_index)
|
|||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
positions[i] = ret;
|
positions[i] = ret;
|
||||||
else {
|
else {
|
||||||
printf("Failed to add key number %u\n", ret);
|
printf("Failed to add key number %u\n", i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -443,7 +443,7 @@ timed_deletes(unsigned with_hash, unsigned with_data, unsigned table_index)
|
|||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
positions[i] = ret;
|
positions[i] = ret;
|
||||||
else {
|
else {
|
||||||
printf("Failed to add key number %u\n", ret);
|
printf("Failed to delete key number %u\n", i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user