Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1036006yba; Fri, 3 May 2019 14:52:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqaPTWxDnYem9zwq9M4a6DWKPnrB2HohBJjalSVL+kAMStl+ck3V9veHRTTHqmPtUrJeBc X-Received: by 2002:a65:4185:: with SMTP id a5mr13609379pgq.82.1556920326372; Fri, 03 May 2019 14:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556920326; cv=none; d=google.com; s=arc-20160816; b=xhmnKuZBSAT+mMbI0or9nODH4BZinY/Db2NYqhIV07+lXJvSxkd8Zlwu/V96s3r/P7 KMPisR7xLjU9bYQ65pTBh6eP19+1AmH77y2ezJkdLsC8z/1CSsta3bSd85HigMFhjFN0 o4KQ0fMiskH16KrWWB5NesmhPxGo5kzbwHS2OrAB1IoL2fUAsoQY4HX3nJzvv229Ea2u 7v0SL+XydeyoSBiiCp8TIA3FPtIs+h8W4Tmyb8GiHe652DKfYPdBxOUZzU/t60n3Wx5N lU3mJqzDpCu2vT36x0lXENki+aQfSHDCZ78y1lDRwe98uiDyM6Tq+dsRERjan/rAnDt5 W1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RG98k7JD5Ajw7trT6CX2XPeLziyYRtZYxJP7/a2/6p0=; b=HKqx9xgkoWofmbe2DLd39SwNbb/L8YlR4LDN3a3sgHEf5ORHXIGtDRv6b1dT6lx6xH q4caeDNbEaO20dv/o59DbrL+JfFqJuzHlLa6sjOm4/bvtdvBy3Fnj3HFSI19H2H5hb69 cWhFHztw+DX0FTCSy6MR5d/Um4qriQuZUsY9ZXsBIQ8eEs4A1nTgKQnn6IDx4bqbasrJ 76yDPeJ6uyzSSdgKXGySZSQw0oCpfXHfY0661GnlajA1urlT+Fp2TAuxqivWfSuR4mxk tykevnlxePV0zTXU+R+QIzGoIR7sRYF4f9p0lx2e990agFlEhaNir8COaRk7ICT+kRL4 9M0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bF31MeNh; 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=pass (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 k9si4008899pfk.158.2019.05.03.14.51.38; Fri, 03 May 2019 14:52:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bF31MeNh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbfECUEl (ORCPT + 99 others); Fri, 3 May 2019 16:04:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfECUEk (ORCPT ); Fri, 3 May 2019 16:04:40 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AA49206BB; Fri, 3 May 2019 20:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556913879; bh=bqpiuHplciGYYVGXRGGsx5652IaGTS8bIlknkgj/3Wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bF31MeNhhlnxwUgjxB340PgJUfm+LawbTZhFeBmncbZV2YSaRIXPxuhW+UVi4LtHn v+lAuY2ZDjoEYg6HQxlRMaU0NjHNKCORxUyiY36jjSLJd8HGPFt2pAqX3An/XaP3OQ tUaVelBDzQvccek3gd5VAbNoRJxrbEwXHXvBTGEg= Date: Fri, 3 May 2019 15:04:37 -0500 From: Bjorn Helgaas To: Frederick Lawler Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, lukas@wunner.de, andriy.shevchenko@linux.intel.com, keith.busch@intel.com, mr.nuke.me@gmail.com, liudongdong3@huawei.com, thesven73@gmail.com Subject: Re: [PATCH v2 6/9] PCI: hotplug: Prefix dmesg logs with PCIe service name Message-ID: <20190503200437.GD180403@google.com> References: <20190503035946.23608-1-fred@fredlawl.com> <20190503035946.23608-7-fred@fredlawl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503035946.23608-7-fred@fredlawl.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 10:59:43PM -0500, Frederick Lawler wrote: > Prefix dmesg logs with PCIe service name. > > Signed-off-by: Frederick Lawler > --- > drivers/pci/hotplug/pciehp.h | 18 +++++++++--------- > drivers/pci/hotplug/pciehp_core.c | 7 +++++-- > drivers/pci/hotplug/pciehp_ctrl.c | 2 ++ > drivers/pci/hotplug/pciehp_hpc.c | 4 +++- > drivers/pci/hotplug/pciehp_pci.c | 2 ++ > 5 files changed, 21 insertions(+), 12 deletions(-) > > diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h > index 506e1d923a1f..78325c8d961e 100644 > --- a/drivers/pci/hotplug/pciehp.h > +++ b/drivers/pci/hotplug/pciehp.h > @@ -34,27 +34,27 @@ extern bool pciehp_debug; > #define dbg(format, arg...) \ > do { \ > if (pciehp_debug) \ > - printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \ > + pr_info(format, ## arg); \ This and > #define ctrl_dbg(ctrl, format, arg...) \ > do { \ > if (pciehp_debug) \ > - dev_printk(KERN_DEBUG, &ctrl->pcie->device, \ > - format, ## arg); \ > + pci_info(ctrl->pcie->port, \ > + format, ## arg); \ this are not like the others. I think replacing the special-purpose pciehp_debug with the generic dynamic debug thing is a good thing, but I'd do it in a separate patch, e.g., - if (pciehp_debug) - printk(KERN_DEBUG ...); + pr_dbg(...); And that patch should also remove the pciehp_debug module parameter and documentation at the same time, of course. And the commit log should include an example of how to turn on these messages, boot with "dyndbg='...'". I don't know what the magic string there needs to be, so it'd be nice to have it in the commit log and in a comment near the dbg() and ctrl_dbg() definitions. > } while (0) > #define ctrl_err(ctrl, format, arg...) \ > - dev_err(&ctrl->pcie->device, format, ## arg) > + pci_err(ctrl->pcie->port, format, ## arg) > #define ctrl_info(ctrl, format, arg...) \ > - dev_info(&ctrl->pcie->device, format, ## arg) > + pci_info(ctrl->pcie->port, format, ## arg) > #define ctrl_warn(ctrl, format, arg...) \ > - dev_warn(&ctrl->pcie->device, format, ## arg) > + pci_warn(ctrl->pcie->port, format, ## arg) > > #define SLOT_NAME_SIZE 10 > > diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c > index fc5366b50e95..7e06a0f9e644 100644 > --- a/drivers/pci/hotplug/pciehp_core.c > +++ b/drivers/pci/hotplug/pciehp_core.c > @@ -17,6 +17,9 @@ > * Dely Sy " > */ > > +#define pr_fmt(fmt) "pciehp: " fmt > +#define dev_fmt pr_fmt Can these go in pciehp.h?