lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b3b1683-c248-466c-9e0b-6d4c986648b9@bootlin.com>
Date: Tue, 25 Feb 2025 15:26:01 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org,
	jbaron@...mai.com, gregkh@...uxfoundation.org, ukaszb@...omium.org
Cc: intel-gfx-trybot@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
	amd-gfx@...ts.freedesktop.org, intel-gvt-dev@...ts.freedesktop.org,
	intel-gfx@...ts.freedesktop.org, daniel.vetter@...ll.ch,
	tvrtko.ursulin@...ux.intel.com, jani.nikula@...el.com,
	ville.syrjala@...ux.intel.com
Subject: Re: [PATCH 20/63] dyndbg: drop premature optimization in
 ddebug_add_module



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 <jim.cromie@...il.com>

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 <louis.chauvet@...tlin.com>

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ