From: "Lee, Chun-Yi" Subject: [PATCH 16/18] Hibernate: show the verification time for monitor performance Date: Thu, 22 Aug 2013 19:01:55 +0800 Message-ID: <1377169317-5959-17-git-send-email-jlee@suse.com> References: <1377169317-5959-1-git-send-email-jlee@suse.com> Cc: linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, opensuse-kernel-stAJ6ESoqRxg9hUCZPvPmw@public.gmane.org, David Howells , "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Pavel Machek , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina-IBi9RG/b67k@public.gmane.org, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal , "Lee, Chun-Yi" To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: In-Reply-To: <1377169317-5959-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: List-Archive: List-Id: linux-crypto.vger.kernel.org Show the verification time for monitor the performance of SHA256 and RSA verification. Reviewed-by: Jiri Kosina Signed-off-by: Lee, Chun-Yi --- 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 36c7157..b9c6a8a 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -2536,6 +2536,8 @@ error_mpi: int snapshot_image_verify(void) { + struct timeval start; + struct timeval stop; struct crypto_shash *tfm; struct shash_desc *desc; u8 *digest; @@ -2563,6 +2565,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; @@ -2581,6 +2585,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); -- 1.6.4.2