[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bc7374f0-4b1c-a632-4581-9e4da0a5090f@linux.intel.com>
Date: Sun, 23 Apr 2023 12:45:10 +0800
From: Zhou Furong <furong.zhou@...ux.intel.com>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
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>
Cc: 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, Eric Dumazet <edumazet@...gle.com>,
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 6/7] drm/i915: Replace custom intel runtime_pm tracker
with ref_tracker library
> +
> +static inline void
> +intel_wakeref_tracker_show(struct ref_tracker_dir *dir,
> + struct drm_printer *p)
> +{
> + const size_t buf_size = PAGE_SIZE;
> + char *buf, *sb, *se;
> + size_t count;
> +
> + buf = kmalloc(buf_size, GFP_NOWAIT);
> + if (!buf)
> + return;
> +
> + count = ref_tracker_dir_snprint(dir, buf, buf_size);
> + if (!count)
> + goto free;
> + /* printk does not like big buffers, so we split it */
> + for (sb = buf; *sb; sb = se + 1) {
> + se = strchrnul(sb, '\n');
> + drm_printf(p, "%.*s", (int)(se - sb + 1), sb);
> + if (!*se)
> + break;
> + }
> + if (count >= buf_size)
> + drm_printf(p, "\n...dropped %zd extra bytes of leak report.\n",
> + count + 1 - buf_size);
> +free:
> + kfree(buf);
> +}
> +
move to c source?
Powered by blists - more mailing lists