Module Name:    src
Committed By:   riastradh
Date:           Wed Feb 12 01:10:08 UTC 2020

Modified Files:
        src/external/cddl/osnet/dist/lib/libdtrace/common: dt_impl.h
            dt_module.c dt_open.c

Log Message:
Use /dev/ksyms, not /netbsd, for the running kernel's symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
    src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h
cvs rdiff -u -r1.17 -r1.18 \
    src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c
cvs rdiff -u -r1.16 -r1.17 \
    src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h:1.8 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h:1.9
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h:1.8	Mon May 28 21:05:05 2018
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h	Wed Feb 12 01:10:08 2020
@@ -750,8 +750,6 @@ extern int yylex(void);
 #endif
 
 #ifdef __NetBSD__
-extern const char *dt_bootfile(char *, size_t);
-
 #define longlong_t long long
 #define u_longlong_t unsigned long long
 #define __DECONST(a, b) __UNCONST(b)

Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.17 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.18
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c:1.17	Sat Jun  2 01:19:46 2018
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c	Wed Feb 12 01:10:08 2020
@@ -43,6 +43,7 @@
 #endif
 #ifdef __NetBSD__
 #include <sys/sysctl.h>
+#include <paths.h>
 #endif
 
 #include <unistd.h>
@@ -1185,9 +1186,7 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 	bool ismod;
 
 	if (strcmp("netbsd", name) == 0) {
-		/* want the kernel, but it is not absolute */
-		dt_bootfile(machine, sizeof(machine));
-		snprintf(fname, sizeof(fname), "/%s", machine);
+		strlcpy(fname, _PATH_KSYMS, sizeof fname);
 		ismod = false;
 	} else {
 

Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.16 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.17
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.16	Wed Jul 24 16:57:45 2019
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c	Wed Feb 12 01:10:08 2020
@@ -1025,24 +1025,15 @@ dt_get_sysinfo(int cmd, char *buf, size_
 }
 #endif
 
-#ifndef illumos
-# ifdef __FreeBSD__
-#  define DEFKERNEL	"kernel"
-#  define BOOTFILE	"kern.bootfile"
-# endif
-# ifdef __NetBSD__
-#  define DEFKERNEL	"netbsd"
-#  define BOOTFILE	"machdep.booted_kernel"
-# endif
-
-const char *
+#ifdef __FreeBSD__
+static const char *
 dt_bootfile(char *bootfile, size_t len)
 {
 	char *p;
 	size_t olen = len;
 
-	if (sysctlbyname(BOOTFILE, bootfile, &len, NULL, 0) != 0)
-		strlcpy(bootfile, DEFKERNEL, olen);
+	if (sysctlbyname("kern.bootfile", bootfile, &len, NULL, 0) != 0)
+		strlcpy(bootfile, "kernel", olen);
 
 	if ((p = strrchr(bootfile, '/')) != NULL)
 		p++;
@@ -1050,9 +1041,6 @@ dt_bootfile(char *bootfile, size_t len)
 		p = bootfile;
 	return p;
 }
-
-# undef DEFKERNEL
-# undef BOOTFILE
 #endif
 
 static dtrace_hdl_t *

Reply via email to