Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jul 2012 12:29:35 +0200
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org, Sean Bruno <sbruno@FreeBSD.org>, rmacklem@FreeBSD.org
Subject:   Re: dtraceall.ko with old nfsclient
Message-ID:  <20120711122935.1382e76d@fabiankeil.de>
In-Reply-To: <4FFC8479.9080608@FreeBSD.org>
References:  <1341863341.6064.11.camel@powernoodle.corp.yahoo.com> <4FFB4770.7050209@FreeBSD.org> <20120710154128.192eb8d6@fabiankeil.de> <1341939155.2573.8.camel@powernoodle.corp.yahoo.com> <20120710205702.5e57168b@fabiankeil.de> <4FFC8479.9080608@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/9sIycTmw_0p6QYzm37pBrn/
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Andriy Gapon <avg@FreeBSD.org> wrote:

> on 10/07/2012 21:57 Fabian Keil said the following:
> > I do not use a completely NFS-free kernel, but I don't build any=20
> > NFS-related modules. Trying to load an unpatched dtraceall results in:
> >=20
> > Jul  9 21:58:48 r500 sudo:       fk : TTY=3Dpts/16 ; PWD=3D/home/fk ; U=
SER=3Droot
> > ; COMMAND=3D/sbin/kldload dtraceall Jul  9 21:58:48 r500 kernel: [8922]=
 KLD
> > dtnfsclient.ko: depends on oldnfs - not available or version mismatch J=
ul
> > 9 21:58:48 r500 kernel: [8922] linker_load_file: Unsupported file type =
Jul
> > 9 21:58:48 r500 kernel: [8922] KLD dtraceall.ko: depends on dtnfsclient=
 -
> > not available or version mismatch Jul  9 21:58:48 r500 kernel: [8922]
> > linker_load_file: Unsupported file type
> >=20
> > My assumption was that your patch and the "#elif defined (NFSCLIENT)" w=
ould
> > fix that, and indeed it does, but I later on realized that I actually do
> > have NFSCL in the kernel:
> >=20
> > fk@r500 /usr/src $sysctl kern.conftxt | grep NFS options NFS_ROOT optio=
ns
> > NFSLOCKD options NFSD options NFSCL
> >=20
> > My impression is that the patch is missing an opt_nfs.h inclusion combi=
ned
> > with the Makefile voodoo to create the file.
> >=20
> > The dtraceall module already has an opt_compat.h, even though the Makef=
ile
> > logic to create it seems a bit dubious to me. It blindly assumes that
> > COMPAT_FREEBSD32 is available on amd64.
>=20
> Not sure if I got correctly what the (perceived) problem actually is, but=
 I
> have this to say: the proper way of building a module is either via
> buildkernel (MODULES_OVERRIDE, etc) or by using KERNBUILDDIR for "indepen=
dent"
> module build if the module has any dependency on kernel options in effect.
> This could be a little bit sad (for third-party module providers), but th=
is
> seems to be true.
>=20
> Sometimes Makefile-s fake kernel options for truly independent module bui=
ld
> (no KERNBUILDDIR) to provide the widest and/or safest feature set.  But t=
his
> has to be done very carefully to ensure that module<->kernel*s* compatibi=
lity
> actually occurs.

I'm using the following modification of Sean's patch:

diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/=
dtraceall/dtraceall.c
index c57f590..d50b1e5 100644
--- a/sys/modules/dtrace/dtraceall/dtraceall.c
+++ b/sys/modules/dtrace/dtraceall/dtraceall.c
@@ -67,8 +67,11 @@ MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtio, 1, 1, 1);
 MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1);
+#if defined (NFSCL)
 MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
+#elif defined (NFSCLIENT)
 MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1);
+#endif
 #if defined(__amd64__) || defined(__i386__)
 MODULE_DEPEND(dtraceall, fbt, 1, 1, 1);
 MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1);

The perceived problem is that after compiling dtraceall with
"make buildkernel", installing it with "make installkernel"
and rebooting, loading it results in:=20

fk@r500 ~ $kldstat
Id Refs Address            Size     Name
 1   73 0xffffffff80200000 e492c0   kernel
 2    1 0xffffffff8104a000 226928   zfs.ko
 3   14 0xffffffff81271000 82b8     opensolaris.ko
 4    1 0xffffffff8127a000 23a48    geom_eli.ko
 5    2 0xffffffff8129e000 34380    crypto.ko
 7    1 0xffffffff812fe000 8640     acpi_video.ko
 8    1 0xffffffff81307000 7d00     acpi_ibm.ko
 9    4 0xffffffff81412000 29e31    usb.ko
10    1 0xffffffff8143c000 32ec     usb_quirk.ko
11    1 0xffffffff81440000 bded     ehci.ko
12    1 0xffffffff8144c000 8d02     umass.ko
13    1 0xffffffff81455000 5c2a     nullfs.ko
14    1 0xffffffff8145b000 51ac     fdescfs.ko
15    1 0xffffffff81461000 beb4     i915.ko
16    1 0xffffffff8146d000 173cc    drm.ko
17    1 0xffffffff81485000 b25      dtraceall.ko
18    1 0xffffffff81486000 4e00     profile.ko
19    3 0xffffffff8148b000 4073     cyclic.ko
20   10 0xffffffff81490000 23b931   dtrace.ko
21    1 0xffffffff816cc000 125da    systrace_freebsd32.ko
22    1 0xffffffff816df000 13797    systrace.ko
23    1 0xffffffff816f3000 44be     sdt.ko
24    1 0xffffffff816f8000 484d     lockstat.ko
25    1 0xffffffff816fd000 bce5     fasttrap.ko
26    1 0xffffffff81709000 6553     fbt.ko
27    1 0xffffffff81710000 448b     dtmalloc.ko
28    1 0xffffffff81715000 43d9     dtio.ko

Note that dtnfscl.ko is not loaded even though loading
it manually works and I have NFSCL in the kernel.

Fabian

--Sig_/9sIycTmw_0p6QYzm37pBrn/
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAk/9VaEACgkQBYqIVf93VJ18rgCeID+tIXTceHLE8cwOtnUm/rVd
V24AmgOtMjwBXve8X7lHyskr+tKEjVbr
=Re94
-----END PGP SIGNATURE-----

--Sig_/9sIycTmw_0p6QYzm37pBrn/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120711122935.1382e76d>