Show the verification time for monitor the performance of SHA256 and RSA
verification.
Signed-off-by: Lee, Chun-Yi
---
kernel/power/snapshot.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
Index: linux/kernel/power/snapshot.c
===================================================================
--- linux.orig/kernel/power/snapshot.c
+++ linux/kernel/power/snapshot.c
@@ -2513,6 +2513,8 @@ error_mpi:
int snapshot_image_verify(void)
{
+ struct timeval start;
+ struct timeval stop;
struct crypto_shash *tfm;
struct shash_desc *desc;
u8 *digest;
@@ -2540,6 +2542,8 @@ int snapshot_image_verify(void)
desc->tfm = tfm;
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
+ do_gettimeofday(&start);
+
ret = crypto_shash_init(desc);
if (ret < 0)
goto error_shash;
@@ -2558,6 +2562,9 @@ int snapshot_image_verify(void)
if (ret)
goto error_verify;
+ do_gettimeofday(&stop);
+ swsusp_show_speed(&start, &stop, nr_copy_pages, "Verified");
+
kfree(h_buf);
kfree(digest);
crypto_free_shash(tfm);
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org