svn commit: r254197 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Rui Paulo
rpaulo at FreeBSD.org
Sat Aug 10 23:17:10 UTC 2013
Author: rpaulo
Date: Sat Aug 10 23:17:09 2013
New Revision: 254197
URL: http://svnweb.freebsd.org/changeset/base/254197
Log:
Load the dtraceall module if /dev/dtrace/dtrace doesn't exist.
MFC after: 3 days
Modified:
head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Aug 10 21:46:58 2013 (r254196)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sat Aug 10 23:17:09 2013 (r254197)
@@ -1086,7 +1086,17 @@ dt_vopen(int version, int flags, int *er
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
More information about the svn-src-all
mailing list