Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2013 23:17:09 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254197 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201308102317.r7ANH9Tg030001@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308102317.r7ANH9Tg030001>