Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2320110rwr; Fri, 21 Apr 2023 07:23:41 -0700 (PDT) X-Google-Smtp-Source: AKy350YBetD9BOxPdIdJrhZBx/xl8YpdsvRSlIH/v7pAfD8f52wtiGDuylQxBlWlGaHDpdZN3nCG X-Received: by 2002:a17:90a:1a10:b0:23b:4bce:97de with SMTP id 16-20020a17090a1a1000b0023b4bce97demr4860908pjk.4.1682087020960; Fri, 21 Apr 2023 07:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682087020; cv=none; d=google.com; s=arc-20160816; b=FkG86J73DRhGgFe7HTf1RGDidaHLry2yiUgy8n58DHutgLOuZUMqUnoWVBYMVS2BQ8 A/ihEBUZ/PojXmcPdJdhJNJtBwY/7/FrgVvqN2js4D6DTDoYzLww83iVmCBzn6s6HPVy pDEwKAygutbtHcrvJZR/SGRamx4SM9DbAXMyT25QxPxlN5LGz709Bb2dSU6+DYFETpUB 1hAcOxQ6ZFMfeVbn2Z5cDO4f2xFbMzydtiu8kVcGXwAMDVIx47eyLb0N0U3IuiUvtg1Q ObYb2xuOD9/mrlqXtNnyu55GvWPgEr8SJ2+kbbWe1x55pGpqcJnJBdEre96ofa1obKup sWdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=z5+C6NfuJNAhAxOI6zMo3D7L7jfA43YGoHVKgeW1YBY=; b=r4Isvw+L2dUGOeyRCQDgUK/lcQziGrAm8kfeNsCVQiYurVHixevRjwfVJVNH/7R9bK IuOPIh9kIERfUSPyHsayCCsWYEQrbldlrr1bN97yKNf1YXZGR7qs9j0cR4OLjmjrCwGP EnkHmRxjfO2beFk/D854xCv5Bzp1GgzzQ0HcnE4881+cUk1oZw6QFHv28zxYrODcAQaj oYnHieuASDCSwckvUa6Yn+zOzMPr54GOJtUe+q+ouLa8LpyYuI+eSET5480Nfq7cKYzu 5mA7J8bPKk6JqQozV52y6cta/+GqsU8VmggIMzvuNtCa1R7SIjlruMbpbNNlp9Wn0+q8 tvWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Yfzy9wOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170903124600b001a5264640cesi4643795plh.534.2023.04.21.07.23.28; Fri, 21 Apr 2023 07:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Yfzy9wOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbjDUOVs (ORCPT + 99 others); Fri, 21 Apr 2023 10:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231821AbjDUOVi (ORCPT ); Fri, 21 Apr 2023 10:21:38 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582A01259E for ; Fri, 21 Apr 2023 07:21:33 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-325f728402cso695805ab.1 for ; Fri, 21 Apr 2023 07:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682086892; x=1684678892; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z5+C6NfuJNAhAxOI6zMo3D7L7jfA43YGoHVKgeW1YBY=; b=Yfzy9wOR7Pi7eDwQXwjXgisJJYtH1mZ/Xi07kQ84EF6nogfkh4g3Q+mbztQRcRA+pZ 4u132+L5PppeRLDFuFMPGVVtjWgCujTt4PGwWZSnAplhOzzfluX/YXEpfGFaGS3//4pI x2h4xB159pU7pmfGk9/fRAXLuxkedJNbLzNZYoY3JOXwazd5JewQieGKgdmMvjgbfThq ScgJapQPDCcJIV30AFY9L0RiYzuduU0uvNLPdGmXl1p5Zqz1Ljy9gvueEXhVmYzhe8fL ick1JJaJXC/vkxhgxTP0uim97CR54h78AO38OwNuAAwpnyRaEHdjR4PdDBUqluN0vTdZ qdHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682086892; x=1684678892; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z5+C6NfuJNAhAxOI6zMo3D7L7jfA43YGoHVKgeW1YBY=; b=XUcnwIfLY/DoCcFZgey6POSLX9bfICKoLWVdBbbUAr9l43ZoLFq764xnKTgVpsiepX YHGd9vPfUCU1ruhSSVSzdPquSjVCtotAb/eBMyK30PEh/I0i0JYIZRf/dcDLUyZJrVTb SpB3RhGFSFDJQE8Vima9xYDs0U6iKt1ft83bIr6b1mhl2PDCazd/WA8ZsS/iaW0pYqTI ph/+xBYHqMknkJngfappX6uph/y6L2xiUK6p/fUijDlLTu+qko8llkci61rA4Abet8bH P9GMMEgypBNr1JaCO3a2fkVHKwXx+ercDm9wkiRs9sNhJTt2tqV6337kMIVhU/uND4Aw SCUQ== X-Gm-Message-State: AAQBX9fovSKOm4HGSNLpHjZoFBv07ZreAEmvbQrcGCHmj+bj5CpNC+cF CwWp2ruc/PpbIWos5ENJfKSp36Muv+Neuf1RI9mLGA== X-Received: by 2002:a05:6e02:18cb:b0:32a:db6c:d51d with SMTP id s11-20020a056e0218cb00b0032adb6cd51dmr327630ilu.12.1682086892452; Fri, 21 Apr 2023 07:21:32 -0700 (PDT) MIME-Version: 1.0 References: <20230224-track_gt-v7-0-11f08358c1ec@intel.com> <20230224-track_gt-v7-2-11f08358c1ec@intel.com> In-Reply-To: <20230224-track_gt-v7-2-11f08358c1ec@intel.com> From: Eric Dumazet Date: Fri, 21 Apr 2023 16:21:17 +0200 Message-ID: Subject: Re: [PATCH v7 2/7] lib/ref_tracker: improve printing stats To: Andrzej Hajda Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , netdev@vger.kernel.org, Jakub Kicinski , Dmitry Vyukov , "David S. Miller" , Andi Shyti Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 1:35=E2=80=AFPM 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 converte= d */ > +#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 ?