Re: [re: PATCH v2 00/15 - 05/11] dyndbg: change +T:name_terminator to dot

From: Łukasz Bartosik
Date: Thu Dec 21 2023 - 10:23:20 EST


pon., 18 gru 2023 o 18:29 Petr Mladek <pmladek@xxxxxxxx> napisał(a):
>
> On Thu 2023-12-07 17:15:08, Jim Cromie wrote:
> > This replaces ',' with '.' as the char that ends the +T:name.
> >
> > This allows a later patch to treat ',' as a space, which mostly
> > eliminates the need to quote query/rules. And this in turn avoids
> > quoting hassles:
> >
> > modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p
> >
> > It is particularly good for passing boot-args into test-scripts.
> >
> > vng -p 4 -v \
> > -a test_dynamic_debug.dyndbg=class,D2_CORE,+p
>
> Could you please add example how it looked before and after?

Before a user had to issue a command in the format
modprobe test_dynamic_debug dyndbg="class D2_CORE +p"

Now a use can use either
modprobe test_dynamic_debug dyndbg="class D2_CORE +p"
or
modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p

> Is this format documented somewhere?
> Will the documentation get updated?

Documentation will be updated.

> Could it break existing scripts? [*]
>

It should not break any scripts as this change does not change the
interface but extends it.

> The dynamic debug interface is really hard to use for me
> as an occasional user. I always have to look into
> Documentation/admin-guide/dynamic-debug-howto.rst
>
> Anyway, there should be a good reason to change the interface.
> And the exaplantion:
>
> "Let's use '.' instead of ',' so that we could later
> treat ',' as space"
>
> sounds scarry. It does not explain what is the advantage at all.
>

I will clarify in the commit message that this change allows to use
two formats either
modprobe test_dynamic_debug dyndbg="class D2_CORE +p"
or
modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p

>
> [*] Some scripts are using the interface even in the mainline,
> for example:
>
> $> git grep "dynamic_debug" tools/testing/
> tools/testing/selftests/bpf/test_tunnel.sh: echo 'file ip_gre.c +p' > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/bpf/test_tunnel.sh: echo 'file ip6_gre.c +p' > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/bpf/test_tunnel.sh: echo 'file geneve.c +p' > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/bpf/test_tunnel.sh: echo 'file ipip.c +p' > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/livepatch/functions.sh: DYNAMIC_DEBUG=$(grep '^kernel/livepatch' /sys/kernel/debug/dynamic_debug/control | \
> tools/testing/selftests/livepatch/functions.sh: echo -n "$DYNAMIC_DEBUG" > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/livepatch/functions.sh:function set_dynamic_debug() {
> tools/testing/selftests/livepatch/functions.sh: cat <<-EOF > /sys/kernel/debug/dynamic_debug/control
> tools/testing/selftests/livepatch/functions.sh: set_dynamic_debug
>

Good to know. I will use these scripts to make sure the dynamic debug
interface is not broken.

Thanks,
Lukasz

>
> Best Regards,
> Petr