From patchwork Sun Sep 15 00:56:58 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: 2894131 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 4D4AABFF05 for ; Sun, 15 Sep 2013 00:59:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C67F202F7 for ; Sun, 15 Sep 2013 00:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C717E202E8 for ; Sun, 15 Sep 2013 00:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732Ab3IOA6i (ORCPT ); Sat, 14 Sep 2013 20:58:38 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:40271 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932720Ab3IOA6d (ORCPT ); Sat, 14 Sep 2013 20:58:33 -0400 Received: by mail-bk0-f46.google.com with SMTP id 6so976235bkj.19 for ; Sat, 14 Sep 2013 17:58:31 -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=8gJfPXI/JUcXqMjgrjdVgmreHHaB/1DU4VO5f92HnGc=; b=A/cc6fmeqaTlN2C2c7CG8O5FV2x1ha8WO/CVh4OnWeQQOAba6nMJ3roKpubZUfBl8E GdlyDb/ocnNan4rZCyHZRKxs7SeFfb1g+dXZplgKSRKC/p2S6JFuOrns+sFM2cxmD3kT y+m3okKLFMOJf///AuFWULo7CxwToADM8LreJtNMjINv+28nAjLR4kq9TkyD3F8yuIx3 /VmLczgjn0Ea47V8W8qCZv3NjxX1aQsErhY3MId6TteQuBul4pKbWEeePlfgJMqAmVVK EaC8iOoJDxsgNRwwZGVI4pE6316ljBzBmYqEMBUosSz8fwq/A9BpmAQEDWYxoygXLytH dDvg== X-Received: by 10.205.36.70 with SMTP id sz6mr17669436bkb.12.1379206711311; Sat, 14 Sep 2013 17:58:31 -0700 (PDT) Received: from localhost.localdomain ([124.11.22.254]) by mx.google.com with ESMTPSA id zl3sm4941613bkb.4.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 14 Sep 2013 17:58:31 -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 V4 12/15] Hibernate: show the verification time for monitor performance Date: Sun, 15 Sep 2013 08:56:58 +0800 Message-Id: <1379206621-18639-13-git-send-email-jlee@suse.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1379206621-18639-1-git-send-email-jlee@suse.com> References: <1379206621-18639-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=-7.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, 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 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()) {