[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b1db3b24-958e-4be8-b979-7c4954a3a678@bootlin.com>
Date: Tue, 25 Feb 2025 15:09:38 +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 07/63] dyndbg: split param_set_dyndbg_classes to _module
& wrapper fns
Le 25/01/2025 à 07:45, Jim Cromie a écrit :
> Split api-fn: param_set_dyndbg_classes(), adding modname param and
> passing NULL in from api-fn.
>
> The new arg allows caller to specify that only one module is affected
> by a prdbgs update. This selectivity will be used later to narrow the
> scope of changes made.
>
> no functional change.
>
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>
Reviewed-by: Louis Chauvet <louis.chauvet@...tlin.com>
> ---
> lib/dynamic_debug.c | 37 ++++++++++++++++++++++---------------
> 1 file changed, 22 insertions(+), 15 deletions(-)
>
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 8adb81e75a16..9adcb9fa7110 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -711,18 +711,9 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa
> return 0;
> }
>
> -/**
> - * param_set_dyndbg_classes - class FOO >control
> - * @instr: string echo>d to sysfs, input depends on map_type
> - * @kp: kp->arg has state: bits/lvl, map, map_type
> - *
> - * Enable/disable prdbgs by their class, as given in the arguments to
> - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative
> - * levels by bitpos.
> - *
> - * Returns: 0 or <0 if error.
> - */
> -int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
> +static int param_set_dyndbg_module_classes(const char *instr,
> + const struct kernel_param *kp,
> + const char *modnm)
> {
> const struct ddebug_class_param *dcp = kp->arg;
> const struct ddebug_class_map *map = dcp->map;
> @@ -759,8 +750,8 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
> KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length));
> inrep &= CLASSMAP_BITMASK(map->length);
> }
> - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp));
> - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL);
> + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp));
> + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm);
> *dcp->bits = inrep;
> break;
> case DD_CLASS_TYPE_LEVEL_NUM:
> @@ -773,7 +764,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
> old_bits = CLASSMAP_BITMASK(*dcp->lvl);
> new_bits = CLASSMAP_BITMASK(inrep);
> v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp));
> - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL);
> + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm);
> *dcp->lvl = inrep;
> break;
> default:
> @@ -782,6 +773,22 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
> vpr_info("%s: total matches: %d\n", KP_NAME(kp), totct);
> return 0;
> }
> +
> +/**
> + * param_set_dyndbg_classes - class FOO >control
> + * @instr: string echo>d to sysfs, input depends on map_type
> + * @kp: kp->arg has state: bits/lvl, map, map_type
> + *
> + * Enable/disable prdbgs by their class, as given in the arguments to
> + * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative
> + * levels by bitpos.
> + *
> + * Returns: 0 or <0 if error.
> + */
> +int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
> +{
> + return param_set_dyndbg_module_classes(instr, kp, NULL);
> +}
> EXPORT_SYMBOL(param_set_dyndbg_classes);
>
> /**
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists