Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "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
Subject: Re: [PATCH] net: set struct net_device::name earlier
Date: Sun, 19 May 2024 15:42:49 +0200	[thread overview]
Message-ID: <a075e64d-1297-4dc9-81b4-8b67f3db3cae@lunn.ch> (raw)
In-Reply-To: <bd68daa3-b8bd-4124-8a0c-dcc3c14bba24@p183>

On Sun, May 19, 2024 at 08:41:40AM +0300, Alexey Dobriyan wrote:
> On Sun, May 19, 2024 at 12:04:05AM +0200, Andrew Lunn wrote:
> > On Sat, May 18, 2024 at 11:24:57PM +0300, Alexey Dobriyan wrote:
> > > I've tried debugging networking allocations with bpftrace and doing
> > > 
> > > 	$dev = (struct net_device*)arg0;
> > > 	printf("dev %s\n", $dev->name);
> > > 
> > > doesn't print anything useful in functions called right after netdevice
> > > allocation. The reason is very simple: dev->name has not been set yet.
> > > 
> > > Make name copying much earlier for smoother debugging experience.
> > 
> > Does this really help?
> 
> Yes and no. One could infer names from stacktraces and overall ordering
> of the allocations but it isn't convenient.
> 
> The snippet works everywhere except small number of functions
> but it doesn't cost anything to make it work everywhere.
> 
> > Instead of "" don't you get "eth%d"? The expansion of the %d to eth42
> > does not happen until you register the netdev.
> 
> Expansion happens later, yes. %d is fine. It is immediately obvious
> which type of device allocates what.

We are in the merge window at the moment, so patches are not being
accepted at the moment. You will need to repost in a weeks time. When
you do, please expand the commit message. The "which type of device"
is what is important here, not the true device name.

Also, please take a look at:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

	Andrew

      reply	other threads:[~2024-05-19 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18 20:24 [PATCH] net: set struct net_device::name earlier Alexey Dobriyan
2024-05-18 22:04 ` Andrew Lunn
2024-05-19  5:41   ` Alexey Dobriyan
2024-05-19 13:42     ` Andrew Lunn [this message]

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=a075e64d-1297-4dc9-81b4-8b67f3db3cae@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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