From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D6B8C7618E for ; Fri, 21 Apr 2023 14:30:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C90210EE33; Fri, 21 Apr 2023 14:30:44 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07B1B10EE33; Fri, 21 Apr 2023 14:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682087442; x=1713623442; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=H8Remee2zEmqfUSIzqd+utYJFsZGQbKHCN0Q/yHbfqI=; b=OMrhgfRuBw/95coy5PmDjnHmC07coFxvGhkDfMvpaUiwq9QDuXiyysZO 1nESKbByfAYyU1Nq15IXDai1cdktfwsM+/Y9AsGwjkqJ9ftTrq/UtSKhG Om2+HNsSau48dIh7ZJNndNmaPBkkMl5BtKeIFNGoNpdrP1m0Oe7QT3b4q 0jH4czUPWrkwwzqY8ad6slPt+l8TOX5KQpeXBdzQnFpNXdGml+gkLlJW1 0XFLgZofWTTL5/NapG7r6fokUZ3o/QoOMafq3W9clhOYtfNRvnxMgvxFj orC5A4x5FIdhJJ8/kc5v6eIZgmrph9IJfiPqhgUYjcV0CLvnVYqObGGyK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="411273237" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="411273237" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 07:30:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10687"; a="836184884" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="836184884" Received: from ahajda-mobl.ger.corp.intel.com (HELO [10.213.8.140]) ([10.213.8.140]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 07:30:36 -0700 Message-ID: Date: Fri, 21 Apr 2023 16:30:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.10.0 Content-Language: en-US To: Eric Dumazet References: <20230224-track_gt-v7-0-11f08358c1ec@intel.com> <20230224-track_gt-v7-2-11f08358c1ec@intel.com> From: Andrzej Hajda Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH v7 2/7] lib/ref_tracker: improve printing stats X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chris Wilson , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , Jakub Kicinski , David Airlie , "David S. Miller" , Dmitry Vyukov Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 21.04.2023 16:21, Eric Dumazet wrote: > On Fri, Apr 21, 2023 at 1:35 PM Andrzej Hajda 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 >> Reviewed-by: Andi Shyti >> --- >> 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 ? If this can be done in one patch, that's great. Regards Andrzej