dtraceall.ko with old nfsclient

Fabian Keil freebsd-listen at fabiankeil.de
Thu Jul 12 18:31:55 UTC 2012


Benjamin Kaduk <kaduk at MIT.EDU> wrote:

> On Wed, 11 Jul 2012, Fabian Keil wrote:
> 
> > I'm using the following modification of Sean's patch:

This way it seems to work as expected:

diff --git a/sys/modules/dtrace/dtraceall/Makefile b/sys/modules/dtrace/dtraceall/Makefile
index 456efd1..628583b 100644
--- a/sys/modules/dtrace/dtraceall/Makefile
+++ b/sys/modules/dtrace/dtraceall/Makefile
@@ -1,7 +1,7 @@
 # $FreeBSD: src/sys/modules/dtrace/dtraceall/Makefile,v 1.3 2011/04/09 09:07:31 uqs Exp $

 KMOD=          dtraceall
-SRCS=          dtraceall.c opt_compat.h
+SRCS=          dtraceall.c opt_compat.h opt_nfs.h

 CFLAGS+=       -I${.CURDIR}/../../..

diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c
index d256489..0672556 100644
--- a/sys/modules/dtrace/dtraceall/dtraceall.c
+++ b/sys/modules/dtrace/dtraceall/dtraceall.c
@@ -33,6 +33,7 @@
 #include <sys/module.h>
 #include <sys/errno.h>
 #include "opt_compat.h"
+#include "opt_nfs.h"

 static int
 dtraceall_modevent(module_t mod __unused, int type, void *data __unused)
@@ -67,8 +68,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);

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

I wasn't entirely clear here, what I meant was that
the KERNCONF used when compiling the module included
"options NFSCL". I didn't expect run-time detection.

> This is because dtraceall.c only #includes opt_compat.h, and the kernel 
> build system only passes -include opt_global.h, so the dtraceall module 
> build has no way of knowing about the NFSCL{IENT,} options defined in 
> opt_nfs.h.  (As you noted earlier in the thread?)

Yes.

> You would still need to address Andriy's comments in order to ensure that 
> the configuration seen by the module matches the kernel.

Sure.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20120712/3be6d106/signature.pgp


More information about the freebsd-hackers mailing list