From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E487B2698BB for ; Tue, 25 Feb 2025 14:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740493568; cv=none; b=p7sIixMvDCS/eW1DbaS/wU23nJAWhfc1nhxyqNoS5m9N/Mi+gweOi+9W4KXtpSF3GwZPyKhvPyhkDHYJrvbPW+Ix1C5VrrWA34if5B3PGd3x1ay+9rejLW/7GKWIimPfOE7vlLRsWLOgZZtAJpf/9qlY635NCC+p1rpMXh3v5Sw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740493568; c=relaxed/simple; bh=FUrFj3PPFdgEF6I2+YW2of97TyNe/PEbmQ/9Sbf5BHU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JiN2VY+RMGsB77P5508xoAd5eR9H0mI9CqeD6WYR3uHJZ9qKb3TSMMvtN/KXFHTDDzAA+2LBTNGF60vff06nhTqDV1B2TeDB3ps3NEhcdBJslvDk/ypcBODJ9we74BiR52YHKMZc4T0eOph9GzX2DylRqBm1ilCYGAwBouy37M8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=lzmuUsxZ; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="lzmuUsxZ" Received: by mail.gandi.net (Postfix) with ESMTPSA id A020A4428E; Tue, 25 Feb 2025 14:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1740493563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zvLOf1Il+fND7fKaPevJ1U14K1YzlRjSMw/lmyXoejg=; b=lzmuUsxZM8l+IaCHD5r/Ozdu+cOVsDDMvjGpnupQjXKYV9d+z2R2s1AEdQgDBCgHpngKmn oCxz7TcKPQBux0LWH/IB37ROtgYViMamEqm49AZY0DkQ5Ivth9QEYfUDHiCHylI2KrQT8I Os+iJgvoo1yo6xHx+HqPvz7FFMIj/8vYI+MJ7I8odWa+UyAvoyAM3qoIsmshic4QC1c7Uk noNtM/41wSxXiD9zZJoGZa2N7ZVwl0bM9Xdkn8WiykkIRzOFaVPBFrwkzXwSpJ2IKBsuUr AYJnJt4WmrqBsq2BYwi3gEwpvxpv+SZYRTD/hXPkMHN86kejN6LY2zVDHrOw7w== Date: Tue, 25 Feb 2025 15:26:01 +0100 From: Louis Chauvet To: Jim Cromie , linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com Subject: Re: [PATCH 20/63] dyndbg: drop premature optimization in ddebug_add_module Message-ID: <9b3b1683-c248-466c-9e0b-6d4c986648b9@bootlin.com> Mail-Followup-To: Jim Cromie , linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com References: <20250125064619.8305-1-jim.cromie@gmail.com> <20250125064619.8305-21-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250125064619.8305-21-jim.cromie@gmail.com> X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekudelgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpefnohhuihhsucevhhgruhhvvghtuceolhhouhhishdrtghhrghuvhgvthessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepudeiffduffeivdejgfejheeuudekkedvjeeuffegfefghfffkeelgffgieevudejnecuffhomhgrihhnpegsohhothhlihhnrdgtohhmnecukfhppeeltddrkeelrdduieefrdduvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledtrdekledrudeifedruddvjedphhgvlhhopehlohhuihhsqdgthhgruhhvvghtqdhlrghpthhophdpmhgrihhlfhhrohhmpehlohhuihhsrdgthhgruhhvvghtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedugedprhgtphhtthhopehjihhmrdgtrhhomhhivgesghhmrghilhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehjsggrrhhonhesrghkrghmrghirdgtohhmpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnr dhorhhgpdhrtghpthhtohepuhhkrghsiigssegthhhrohhmihhumhdrohhrghdprhgtphhtthhopehinhhtvghlqdhgfhigqdhtrhihsghotheslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrghdprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheprghmugdqghhfgieslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrgh X-GND-Sasl: louis.chauvet@bootlin.com Le 25/01/2025 à 07:45, Jim Cromie a écrit : > The class_ct var was added to avoid 2 function calls, but to do this > it loops over all the module's debug callsites to determine the count. > But it doesn't really help, so remove it. > > Signed-off-by: Jim Cromie Hi Jim, If you move the other patch earlier, can you also move this one before "for_subvec", so you don't change the same lines twice. Reviewed-by: Louis Chauvet Thanks, Louis Chauvet > --- > lib/dynamic_debug.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c > index 067db504dd1d..16c9b752822b 100644 > --- a/lib/dynamic_debug.c > +++ b/lib/dynamic_debug.c > @@ -1284,8 +1284,6 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, > static int ddebug_add_module(struct _ddebug_info *di, const char *modname) > { > struct ddebug_table *dt; > - struct _ddebug *iter; > - int i, class_ct = 0; > > if (!di->descs.len) > return 0; > @@ -1308,18 +1306,14 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) > > INIT_LIST_HEAD(&dt->link); > > - for_subvec(i, iter, di, descs) > - if (iter->class_id != _DPRINTK_CLASS_DFLT) > - class_ct++; > - > - if (class_ct && di->maps.len) > + if (di->maps.len) > ddebug_attach_module_classes(dt, di); > > mutex_lock(&ddebug_lock); > list_add_tail(&dt->link, &ddebug_tables); > mutex_unlock(&ddebug_lock); > > - if (class_ct && di->users.len) > + if (di->users.len) > ddebug_attach_user_module_classes(dt, di); > > vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com