Thread (52 messages) 52 messages, 11 authors, 2013-10-17
STALE4661d REVIEWED: 1 (0M)
Revisions (4)
  1. v3 [diff vs current]
  2. v4 current
  3. rfc [diff vs current]
  4. v2 [diff vs current]

[PATCH V4 12/15] Hibernate: show the verification time for monitor performance

From: Lee, Chun-Yi <hidden>
Date: 2013-09-15 00:58:38
Also in: linux-efi, linux-pm, lkml
Subsystem: hibernation (aka software suspend, aka swsusp), suspend to ram, the rest · Maintainers: "Rafael J. Wysocki", Linus Torvalds

Show the verification time for monitor the performance of SHA256 and RSA
verification.

Reviewed-by: Jiri Kosina <redacted>
Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
---
 kernel/power/snapshot.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 8a166e1..804feb6 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -2529,6 +2529,8 @@ static void snapshot_fill_sig_forward_info(int sig_check_ret)
 
 int snapshot_image_verify(void)
 {
+	struct timeval start;
+	struct timeval stop;
 	struct crypto_shash *tfm = NULL
 	struct shash_desc *desc;
 	u8 *digest = NULL;
@@ -2560,6 +2562,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;
@@ -2580,6 +2584,9 @@ int snapshot_image_verify(void)
 	else
 		pr_info("PM: snapshot signature check SUCCESS!\n");
 
+	do_gettimeofday(&stop);
+	swsusp_show_speed(&start, &stop, nr_copy_pages, "Verified");
+
 forward_ret:
 	/* forward check result when pass or not enforce verify success */
 	if (!ret || !sig_enforced()) {
-- 
1.6.0.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help