[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLUDXz9VAtCQ6Gr2Jkxogdu_5g0tN9iCkAB0JD_B_05Gw@mail.gmail.com>
Date: Fri, 21 Apr 2023 16:21:17 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Andrzej Hajda <andrzej.hajda@...el.com>
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, linux-kernel@...r.kernel.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
Chris Wilson <chris@...is-wilson.co.uk>,
netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Andi Shyti <andi.shyti@...ux.intel.com>
Subject: Re: [PATCH v7 2/7] lib/ref_tracker: improve printing stats
On Fri, Apr 21, 2023 at 1:35 PM Andrzej Hajda <andrzej.hajda@...el.com> wrote:
>
> In case the library is tracking busy subsystem, simply
> printing stack for every active reference will spam log
> with long, hard to read, redundant stack traces. To improve
> readabilty following changes have been made:
> - reports are printed per stack_handle - log is more compact,
> - added display name for ref_tracker_dir - it will differentiate
> multiple subsystems,
> - stack trace is printed indented, in the same printk call,
> - info about dropped references is printed as well.
>
> Signed-off-by: Andrzej Hajda <andrzej.hajda@...el.com>
> Reviewed-by: Andi Shyti <andi.shyti@...ux.intel.com>
> ---
> include/linux/ref_tracker.h | 15 ++++++--
> lib/ref_tracker.c | 90 +++++++++++++++++++++++++++++++++++++++------
> 2 files changed, 91 insertions(+), 14 deletions(-)
>
> diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
> index 87a92f2bec1b88..fc9ef9952f01fd 100644
> --- a/include/linux/ref_tracker.h
> +++ b/include/linux/ref_tracker.h
> @@ -17,12 +17,19 @@ struct ref_tracker_dir {
> bool dead;
> struct list_head list; /* List of active trackers */
> struct list_head quarantine; /* List of dead trackers */
> + char name[32];
> #endif
> };
>
> #ifdef CONFIG_REF_TRACKER
> -static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir,
> - unsigned int quarantine_count)
> +
> +/* Temporary allow two and three arguments, until consumers are converted */
> +#define ref_tracker_dir_init(_d, _q, args...) _ref_tracker_dir_init(_d, _q, ##args, #_d)
> +#define _ref_tracker_dir_init(_d, _q, _n, ...) __ref_tracker_dir_init(_d, _q, _n)
> +
We only have four callers of ref_tracker_dir_init() .
Why not simply add a name on them, and avoid this magic ?
Powered by blists - more mailing lists