Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp425394ybb; Wed, 1 Apr 2020 02:47:05 -0700 (PDT) X-Google-Smtp-Source: APiQypLCsn9KS1jLrhw10E2tSeviK0J5MtbPaPwYmYstbDewE8hTktSsnkMiS30hI8f4UvGmapZ5 X-Received: by 2002:aca:4d47:: with SMTP id a68mr2299197oib.56.1585734425025; Wed, 01 Apr 2020 02:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585734425; cv=none; d=google.com; s=arc-20160816; b=Pe0/Wkfq9iTCmrJF8HvrEMXyDohzJ8UlGHEMo9SsMn4GPAG9ieAFl0m8Kbzkc54prp Q2Rrnt1DgpuZeg0eHWLXXPk3r4jlx1s6dtpNPIxYHo10tb6pz6tNIcnKBDT0WJcfhRva vpzC0/zyt9kiwTl+9c0v/fSpcpwng0n+3EXN40IiJTArl39TOq5+UaNpjWtg7+hm5BTB sBbhQzq03Y3guLwnFABC3TIeUXqdNc1saA74jzJr9xX2ifv/+CPJaBlt+X3OKuaxe6RO VX5JHCRxr3uwUjEXsWvHh1lVALyPoJ00AES/MVm2rXEnpbRvkwmy3PKHCJ3hJnjSaguq im4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Tc/XOc5/LK1Q2z5fURAPBVNdJRpf3W6JCMUDG26GjAA=; b=Fw5QiJYkG3DJ/2ChvqWRRt2d9lTv1SkD0fyAQfS1ZyOBgrQ/WkVOEEpARL0EBoAykQ FUMxmO3DBR46WY/wOUSDh04fCCpww3KdIPnGnSdCKI+KXvH0qAA1atVL3gDlW66bA69B oUW/xrhvxhvgQ5TC3/Ntc/BM2b+VJ6POX8WZyGydDFihLTquPyBIHXd3urhiAlvdPCWp cd/itssb1OitJlONgmc3HhSvLjJRcoTDP8rO8tPOw76p906f+XnNt4BWntGRJ3hycgph t5O0ALWzsBO5W+ZNru1oJTxkhUZDad3vcgduV7xKMttXJiIk3LWgjJgbKqG/1CagRii0 4CIA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si604625oof.2.2020.04.01.02.46.49; Wed, 01 Apr 2020 02:47:05 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732191AbgDAJoE (ORCPT + 99 others); Wed, 1 Apr 2020 05:44:04 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:46153 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731608AbgDAJoD (ORCPT ); Wed, 1 Apr 2020 05:44:03 -0400 Received: by mail-oi1-f193.google.com with SMTP id q204so21580958oia.13; Wed, 01 Apr 2020 02:44:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tc/XOc5/LK1Q2z5fURAPBVNdJRpf3W6JCMUDG26GjAA=; b=ppLeAwfEvUJnGL9KZATgfL72F6SWFf6GmzF2TwLZ1/r05alfHZ8ArydD2z8ryt1VKy PMmxoeHjVekvT+U5bBiG6mVxfWiaPL2O4wQ5J3J55e3U8YEE1bY6nyisx7PcQW9K1chs 1RhSGVwJ7C0O1Bp5c9LgYAJ6Ft06x3CpBnKnN9k/SksL2etKhXQkdpTxvojZT6DkZgtn dJo6y+oHWxY1/P8crUXyR+tbhBIQMs0Hf+366aaWaamB+GXs6Pm0+A0AK1PmVk2fdwC1 f3az4ajEWHbrT0oGTax/6VM3htyNFVP913+TbobQdH2o++7HRRy0cpH/itvjLHUs2rna NXpw== X-Gm-Message-State: AGi0PuZGyYdO8ItbzDAtrqbFX5Z07GJdalhc3/nA1iRd2rxL92a/rgXt bnOEss7hSShztx/KAwt8PwBdfy7AYo+W0/Yw3LE= X-Received: by 2002:aca:2209:: with SMTP id b9mr2183308oic.103.1585734243209; Wed, 01 Apr 2020 02:44:03 -0700 (PDT) MIME-Version: 1.0 References: <20200329144640.20536-1-yu.c.chen@intel.com> In-Reply-To: <20200329144640.20536-1-yu.c.chen@intel.com> From: "Rafael J. Wysocki" Date: Wed, 1 Apr 2020 11:43:51 +0200 Message-ID: Subject: Re: [PATCH][v2] PM / sleep: Add pm_debug_messages boot command control To: Chen Yu Cc: Linux PM , Jonathan Corbet , Pavel Machek , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Mauro Carvalho Chehab , Thomas Gleixner , Josh Poimboeuf , Andrew Morton , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko , Randy Dunlap Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 29, 2020 at 4:48 PM Chen Yu wrote: > > 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_message'. > > 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 > --- > 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 c07815d230bc..105ec73743d7 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -3698,6 +3698,9 @@ > Override pmtimer IOPort with a hex value. > e.g. pmtmr=0x508 > > + pm_debug_message [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..1da3d7c15e03 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_message_setup(char *str) > +{ > + pm_debug_messages_on = true; > + return 1; > +} > +__setup("pm_debug_message", pm_debug_message_setup); I'd call this "pm_debug_messages" (just like the sysfs knob) and rename the rest accordingly. > + > /** > * __pm_pr_dbg - Print a suspend debug message to the kernel log. > * @defer: Whether or not to use printk_deferred() to print the message. > --