summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2013-08-10 23:17:09 +0000
committerrpaulo <rpaulo@FreeBSD.org>2013-08-10 23:17:09 +0000
commit10427f9082e3a8df9b9618153e05f8b1e9a78071 (patch)
tree0f954412779caf7c0918a09e0716dc8503559afe /cddl
parent5c0ad988c9fafee15446d1771718c2401746b243 (diff)
downloadFreeBSD-src-10427f9082e3a8df9b9618153e05f8b1e9a78071.zip
FreeBSD-src-10427f9082e3a8df9b9618153e05f8b1e9a78071.tar.gz
Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.
MFC after: 3 days
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
index 25f9956..9c9b2a6 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
@@ -1086,7 +1086,17 @@ dt_vopen(int version, int flags, int *errp,
dtfd = open("/dev/dtrace/dtrace", O_RDWR);
err = errno; /* save errno from opening dtfd */
-
+#if defined(__FreeBSD__)
+ /*
+ * Automatically load the 'dtraceall' module if we couldn't open the
+ * char device.
+ */
+ if (err == ENOENT && modfind("dtraceall") < 0) {
+ kldload("dtraceall"); /* ignore the error */
+ dtfd = open("/dev/dtrace/dtrace", O_RDWR);
+ err = errno;
+ }
+#endif
#if defined(sun)
ftfd = open("/dev/dtrace/provider/fasttrap", O_RDWR);
#else
OpenPOWER on IntegriCloud