Re: [PATCH] net: add a debugfs files for showing netns refcount tracking info

From: Jeff Layton
Date: Mon Mar 24 2025 - 20:38:07 EST


On Mon, 2025-03-24 at 21:50 +0100, Andrew Lunn wrote:
> On Mon, Mar 24, 2025 at 04:24:47PM -0400, Jeff Layton wrote:
> > CONFIG_NET_NS_REFCNT_TRACKER currently has no convenient way to display
> > its tracking info. Add a new net_ns directory in debugfs. Have a
> > directory in there for every net, with refcnt and notrefcnt files that
> > show the currently tracked active and passive references.
>
> Hi Jeff
>
> CONFIG_NET_NS_REFCNT_TRACKER is just an instance of
> CONFIG_REF_TRACKER.
>
> It would be good to explain why you are doing it at the netdev level,
> rather than part of the generic CONFIG_REF_TRACKER level. Why would
> other subsystems not benefit from having their reference trackers in
> debugfs?
>
>

Mostly because I just needed the NS_REFCNT_TRACKER at the time.

I'm OK with making this more general, but all of those subsystems using
refcount trackers would need to add the infrastructure to create
directories to track them.

To whit:

What would the directory structure look like for the more general case?
--
Jeff Layton <jlayton@xxxxxxxxxx>