Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1462232ybb; Thu, 2 Apr 2020 00:59:27 -0700 (PDT) X-Google-Smtp-Source: APiQypKB1YqqQB7sqV0UbBVt6XzBz/bIhhktjHRz7jI7IMq/VNaZxEgyF7Ly/NlLQipsbVRgXFxZ X-Received: by 2002:a4a:874f:: with SMTP id a15mr1762810ooi.8.1585814367103; Thu, 02 Apr 2020 00:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585814367; cv=none; d=google.com; s=arc-20160816; b=aIYJ1T8NwsKziqJPHO6Rwz8HLMZV9/ESB3ykCjQM9E8xFI55ErapF+UUcVzwa9KPcs l1EU2Nb093BLLSbps2eEsvFWoYjNNHVCrM84n+C+JAifTxxzNJpH8xYzlRDMRvf4APi0 TKPu78WkfGDxs7as4xAdryOBr0RZ0ot3S0LEshpNzb9wA2+sZAxmRpW/kWasCCApe6ZB OFHs7Ae6NqKz2BaDp0P2MJDEL87VaKoCZm6JHki3ES5KRMJwKW/7+b/2XC/6GsL97FmF Q+bX7AZ+KI2AzRshby+qlTPZfqkt8KS2Q89O9Mt85dtp9OqiPXgE0J5nfDytVqUcLYwS Acgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=02bXCX4eyUPbVtVGYjfpqwzv6KMqhqFYP4DCnrkkcP4=; b=agz45b4jN0woZ/qNmMiPqWtaTtqH5Y9CWyDcjZ6j0Xyp/0mauVeLUtIzsx3X/pd3VZ aiSzTDf0Su9H/k0FO7miKZcXd/kAuhVBD8zMzDANs4BxxahFcnWW8OMnEGKB3l+23wLH u7nyHX5V/rHN1SQ2t1/aHAblJkVInVs3+CSzPktcrhfJEbfFeKlgSYtGUwvnY5C7G3Mh RR1qu3sozw3YZ4SmciBPRO/DyUXVqIUSgOa1Yn/WEqj7exmyQmD/RVjw9TXoM2eiTsPw AE8msgwBiCN6ABVpb46xThfVpNf+/IT9aI+Gq19xVirRG1WC1UCs2TvTyb2eJFKQm3jl n+VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n190si2081663oig.207.2020.04.02.00.59.15; Thu, 02 Apr 2020 00:59:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387667AbgDBH6Y (ORCPT + 99 others); Thu, 2 Apr 2020 03:58:24 -0400 Received: from mga02.intel.com ([134.134.136.20]:21192 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgDBH6X (ORCPT ); Thu, 2 Apr 2020 03:58:23 -0400 IronPort-SDR: RMdMDC4xPTADYH2XmaMBFhhVvLroWAd6LDBKiIc4zhT05neeiG931pHXiOjIZ8ZZQCRvoFlqbp TK7xieU2L2GQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 00:58:22 -0700 IronPort-SDR: aWH9WU2pFjjgDUCmJAflWgcnacYwmqpUottW9hVSjKilfTfLSLozUVxCbsFcpHCXLgRBwcJ1GL zHXsu4/5/knQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="273469236" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga004.fm.intel.com with ESMTP; 02 Apr 2020 00:58:19 -0700 From: Chen Yu To: linux-pm@vger.kernel.org Cc: Jonathan Corbet , Pavel Machek , Mauro Carvalho Chehab , Thomas Gleixner , Josh Poimboeuf , Andrew Morton , linux-doc@vger.kernel.org, Pawan Gupta , linux-kernel@vger.kernel.org, Chen Yu , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko , Randy Dunlap Subject: [PATCH][v3] PM / sleep: Add pm_debug_messages boot command control Date: Thu, 2 Apr 2020 15:56:52 +0800 Message-Id: <20200402075652.13289-1-yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Debug messages from the system suspend/hibernation infrastructure is disabled by default, and can only be enabled after the system has boot up via /sys/power/pm_debug_messages. This makes the hibernation resume hard to track as it involves system boot up across hibernation. There's no chance for software_resume() to track the resume process, eg. Turning on the pm_debug_messages during boot up by appending 'pm_debug_messages'. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Andy Shevchenko Cc: Randy Dunlap Signed-off-by: Chen Yu --- v2: According to Randy's suggestion, add the command line option to Documentation/admin-guide/kernel-parameters.txt v3: According to Rafael's suggestion, rename the boot command to pm_debug_messages --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ kernel/power/main.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index ed73df5f1369..3fb9cbee8d28 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3720,6 +3720,9 @@ Override pmtimer IOPort with a hex value. e.g. pmtmr=0x508 + pm_debug_messages [SUSPEND,KNL] + Enable suspend/resume debug messages during boot up. + pnp.debug=1 [PNP] Enable PNP debug messages (depends on the CONFIG_PNP_DEBUG_MESSAGES option). Change at run-time diff --git a/kernel/power/main.c b/kernel/power/main.c index 69b7a8aeca3b..40f86ec4ab30 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj, power_attr(pm_debug_messages); +static int __init pm_debug_messages_setup(char *str) +{ + pm_debug_messages_on = true; + return 1; +} +__setup("pm_debug_messages", pm_debug_messages_setup); + /** * __pm_pr_dbg - Print a suspend debug message to the kernel log. * @defer: Whether or not to use printk_deferred() to print the message. -- 2.17.1