netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Matt Johnston <matt@codeconstruct.com.au>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	Santosh Puranik <spuranik@nvidia.com>
Subject: Re: [PATCH net-next 2/2] net: mctp: Add MCTP USB transport driver
Date: Fri, 7 Feb 2025 13:18:39 +0100	[thread overview]
Message-ID: <2025020731-malformed-pendant-e283@gregkh> (raw)
In-Reply-To: <f670c97228b7ae8ac1efd426f83438825e800625.camel@codeconstruct.com.au>

On Fri, Feb 07, 2025 at 05:45:33PM +0800, Jeremy Kerr wrote:
> Hi Greg,
> 
> > > > > +               dev_err(&mctp_usb->usbdev->dev, "%s: urb status: %d\n",
> > > > > +                       __func__, status);
> > > > 
> > > > This could flood the logs, are you sure you need it at dev_err()
> > > > level?
> > > > 
> > > > And __func__ is redundant, it's present in dev_*() calls already.
> > > 
> > > am I missing something then?
> > > 
> > >    [  146.130170] usb 2-1: short packet (hdr) 6
> > > 
> > > emitted from:
> > > 
> > >     dev_dbg(&mctp_usb->usbdev->dev,
> > >             "short packet (hdr) %d\n",
> > >             hdr->len);
> > > 
> > > Seems like we get the driver name, but not the function.
> > > 
> > > I'm happy to remove the __func__ output either way, but I will also
> > > make the logs a little more descriptive for context, if we don't have
> > > func data.
> > 
> > Please read Documentation/admin-guide/dynamic-debug-howto.rst, it shows
> > how to get the function information from the dev_dbg() lines at runtime.
> > 
> > In short:
> >         $ alias ddcmd='echo $* > /proc/dynamic_debug/control'
> >         # add function to all enabled messages
> >         $ ddcmd '+f'
> 
> Your original comment was on the dev_err() call though (sorry, I've
> complicated the discussion by using a dev_dbg() example).

Sorry, I got confused here too, I saw it on dev_dbg() calls in my
review.

> Looks like only dev_dbg (and not _err/_warn/etc) has provision for
> __func__, is that right?

Yes.

> I've since removed the __func__ references anyway, and replaced with
> better context on the messages, but keen to make sure I have the correct
> understanding in general.

That sounds better, avoiding __func__ wherever possible is usually a
good idea.

thanks,

gre gk-h

  reply	other threads:[~2025-02-07 12:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06  6:48 [PATCH net-next 0/2] mctp: Add MCTP-over-USB hardware transport binding Jeremy Kerr
2025-02-06  6:48 ` [PATCH net-next 1/2] usb: Add base USB MCTP definitions Jeremy Kerr
2025-02-06  7:03   ` Greg Kroah-Hartman
2025-02-06  7:11     ` Jeremy Kerr
2025-02-06  7:22       ` Greg Kroah-Hartman
2025-02-06  7:36         ` Jeremy Kerr
2025-02-06  8:14           ` Greg Kroah-Hartman
2025-02-06  6:48 ` [PATCH net-next 2/2] net: mctp: Add MCTP USB transport driver Jeremy Kerr
2025-02-06  7:07   ` Greg Kroah-Hartman
2025-02-07  8:49     ` Jeremy Kerr
2025-02-07  9:10       ` Greg Kroah-Hartman
2025-02-07  9:45         ` Jeremy Kerr
2025-02-07 12:18           ` Greg Kroah-Hartman [this message]
2025-02-06 11:12   ` Oliver Neukum
2025-02-07  7:45     ` Jeremy Kerr
2025-02-07 15:26   ` Simon Horman
2025-02-10  1:57     ` Jeremy Kerr
2025-02-20 18:13   ` Jeff Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2025020731-malformed-pendant-e283@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jk@codeconstruct.com.au \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=spuranik@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).