Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 2020 14:47:10 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        =?UTF-8?B?U3RlZmFuIEXDn2Vy?= <st.esser@yahoo.de>
Cc:        freebsd-current@freebsd.org
Subject:   Re: option KDTRACE_HOOKS non-optional after r357912?
Message-ID:  <CAGudoHG7F65Pr%2BV=w3BqrT4BKGvujPYB78Vek%2BMRf9je-FWW6g@mail.gmail.com>
In-Reply-To: <ee9f3c6b-a0f9-5586-1713-78d132c1c6d4@yahoo.de>
References:  <ee9f3c6b-a0f9-5586-1713-78d132c1c6d4.ref@yahoo.de> <ee9f3c6b-a0f9-5586-1713-78d132c1c6d4@yahoo.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2/15/20, Stefan E=C3=9Fer <st.esser@yahoo.de> wrote:
> Hi Mateusz,
>
> your optimization of systrace checks has made KDTRACE_HOOKS mandatory,
> since there are unprotected assignments to systrace_enabled (which is
> defined as constant 0 in kernels without KDTRACE_HOOKS due to your
> change):
>
> /sys/cddl/dev/systrace/systrace.c:322:20: error: expression is not
> assignable
>                 systrace_enabled =3D true;
>                 ~~~~~~~~~~~~~~~~ ^
> /sys/cddl/dev/systrace/systrace.c:334:20: error: expression is not
> assignable
>                 systrace_enabled =3D false;
>                 ~~~~~~~~~~~~~~~~ ^
> 2 errors generated.
> *** [systrace.o] Error code 1
>
> The easy work-around is of course to add KDTRACE_HOOKS to the stripped
> down kernel configuration. But I think there should be stab functions
> in systrace.c to cover the case that this option is not active.
>
> Or is the overhead and other impact of KDTRACE_HOOKS considered to be
> so insignificant that it should be included in every kernel?
>

Well tinderbox built for me.

Note that the module strongly depends on KDTRACE_HOOKS to work in the
first place -- even prior to my patch support in the syscall path was gated=
 by
this define. In other words, the module should not be being built if the op=
tion
is not enabled. Thus if anything the change adds an unintended improvement
of catching the lack of dependency checking here. I may take a closer look
later but preferably someone familiar with the build system would take
care of it.

It comes with some overhead of course since there is no hot patching, but
it is unlikely you will be able to measure it because of other factors.

--=20
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHG7F65Pr%2BV=w3BqrT4BKGvujPYB78Vek%2BMRf9je-FWW6g>