tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Move kern_ctf to the dtrace module?



On Mon, 12 Sep 2016, Paul Goyette wrote:

Currently, if you include KDTRACE_HOOKS in your kernel, we automatically include src/sys/kern/kern_ctf.[co] in the resulting kernel.

kern_ctf defines only one global symbol, mod_ctf_get(), according to the generated netbsd.map file, and there are no references anywhere else in the kernel to this routine; the only reference is within the sub-module dtrace_fbt.kmod

I would like to suggest that kern_ctf be removed from the kernel, and added to the dtrace_fbt module. And, since kern_ctf references stuff in net/zlib.c, the dtrace_fbt module should depend on zlib module. And finally, the ktrace_hooks dependency can be removed from the zlib.c line in net/files.net

The bottom line is that zlib code won't be included in kernels that don't need it, yet will still be available when using dtrace (which is only available as a module).


If I don't see any significant objections, I'll post diffs in a day or so before making any commits.

Diffs are attached here.

I plan to commit within the next couple of days...



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+
Index: external/cddl/osnet/dev/fbt/fbt.c
===================================================================
RCS file: /cvsroot/src/external/cddl/osnet/dev/fbt/fbt.c,v
retrieving revision 1.19
diff -u -p -r1.19 fbt.c
--- external/cddl/osnet/dev/fbt/fbt.c	17 Jul 2016 02:09:10 -0000	1.19
+++ external/cddl/osnet/dev/fbt/fbt.c	12 Sep 2016 03:31:19 -0000
@@ -2141,4 +2141,4 @@ fbt_open(dev_t dev, int flags, int mode,
 	return (0);
 }
 
-MODULE(MODULE_CLASS_MISC, dtrace_fbt, "dtrace");
+MODULE(MODULE_CLASS_MISC, dtrace_fbt, "dtrace,zlib");

Index: sys/kern/files.kern
===================================================================
RCS file: /cvsroot/src/sys/kern/files.kern,v
retrieving revision 1.11
diff -u -p -r1.11 files.kern
--- sys/kern/files.kern	9 Apr 2016 06:21:16 -0000	1.11
+++ sys/kern/files.kern	12 Sep 2016 03:31:27 -0000
@@ -33,7 +33,10 @@ file	kern/kern_clock.c		kern
 file	kern/kern_condvar.c		kern
 file	kern/kern_core.c		coredump
 file	kern/kern_cpu.c			kern
-file	kern/kern_ctf.c			kdtrace_hooks
+
+#kern/kern_ctf.c is only needed as part of dtrace_fbt module
+#file	kern/kern_ctf.c			kdtrace_hooks
+
 file	kern/kern_descrip.c		kern
 file	kern/kern_event.c		kern
 file	kern/kern_exec.c		kern

Index: sys/modules/dtrace/fbt/Makefile
===================================================================
RCS file: /cvsroot/src/sys/modules/dtrace/fbt/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- sys/modules/dtrace/fbt/Makefile	18 Sep 2014 19:45:24 -0000	1.5
+++ sys/modules/dtrace/fbt/Makefile	12 Sep 2016 03:31:34 -0000
@@ -7,7 +7,11 @@
 KMOD=		dtrace_fbt
 SRCS=		fbt.c
 
-CPPFLAGS+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys \
+.PATH:	${S}/kern
+
+SRCS+=		kern_ctf.c
+
+CPPFLAGS.fbt.c+=	-I${NETBSDSRCDIR}/external/cddl/osnet/sys \
 		-I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common 
 
 CPPFLAGS+=	-Wno-unknown-pragmas

Index: sys/net/files.net
===================================================================
RCS file: /cvsroot/src/sys/net/files.net,v
retrieving revision 1.10
diff -u -p -r1.10 files.net
--- sys/net/files.net	10 Aug 2016 05:56:30 -0000	1.10
+++ sys/net/files.net	12 Sep 2016 03:31:38 -0000
@@ -49,7 +49,7 @@ file	net/route.c			net
 file	net/rtbl.c			net
 file	net/rtsock.c			net
 file	net/slcompress.c		sl | ppp | strip | (irip & irip_vj)
-file	net/zlib.c			(ppp & ppp_deflate) | swcrypto | vnd_compression | kdtrace_hooks
+file	net/zlib.c			(ppp & ppp_deflate) | swcrypto | vnd_compression
 file	netinet/accf_data.c		accf_data
 file	netinet/accf_http.c		accf_http
 file	netinet/cpu_in_cksum.c		(inet | inet6) & !cpu_in_cksum


Home | Main Index | Thread Index | Old Index