From patchwork Thu Aug 22 11:01:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yi Lee X-Patchwork-Id: 2848196 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A900CBF546 for ; Thu, 22 Aug 2013 11:07:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8399B2061F for ; Thu, 22 Aug 2013 11:07:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B8852061E for ; Thu, 22 Aug 2013 11:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753913Ab3HVLG1 (ORCPT ); Thu, 22 Aug 2013 07:06:27 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:56840 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134Ab3HVLGY (ORCPT ); Thu, 22 Aug 2013 07:06:24 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so1730288pdj.31 for ; Thu, 22 Aug 2013 04:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RAm/Zh+GYKVXPcyoajVtgXMOva7YoGCVZbbBL4qhM0o=; b=OASH8IINZhcQT2n/qVMM0CzCsC+lPyA91T1kqhoLWuAhfZZoXnF25gBl0bLs3GLOmW PAb0Cv0vVahQ+H4kOlvNlKHPj31ILhbBy9z2lhB9BsoM6wSJ9Q+yun6T0sAQcxbeTJOu 3fQmfDPGKZzIlqZew00z1WF/Xr0AAHYS/BVbimUkc7G89a2unwTixB/zOpBSuMNN3mTA io4CNcGXgoI/gL8+plnGSNRPumb2KU6IlNc7iVhX7scW8onqxgOVKt9gI9nLqDVlO8pC yUPKpXPRB7q/eK3r431lzP4YKV3F3MawA4X3T+lfWtsM5SdL+HmKCpyWdV9eZjwQhE+p D7Hw== X-Received: by 10.66.150.41 with SMTP id uf9mr4828455pab.108.1377169583335; Thu, 22 Aug 2013 04:06:23 -0700 (PDT) Received: from localhost.localdomain ([130.57.30.250]) by mx.google.com with ESMTPSA id ht5sm14182603pbb.29.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 Aug 2013 04:06:22 -0700 (PDT) From: "Lee, Chun-Yi" To: linux-kernel@vger.kernel.org Cc: linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-pm@vger.kernel.org, linux-crypto@vger.kernel.org, opensuse-kernel@opensuse.org, David Howells , "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Pavel Machek , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina@suse.com, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal , "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> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1377169317-5959-1-git-send-email-jlee@suse.com> References: <1377169317-5959-1-git-send-email-jlee@suse.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);