Merge from OpenSolaris (30-Jun-2009):

6851093 system drops to kmdb with anonymous dtrace probes + kmdb

This has no effect on FreeBSD (code is ifdef'ed) but is useful as
reference for future merges.

MFC after:	1 week
This commit is contained in:
Pedro F. Giffuni 2014-07-03 19:25:24 +00:00
parent 87e109c3e0
commit 99d8c6efbd

View File

@ -16750,7 +16750,7 @@ dtrace_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
if (state == NULL) {
#if defined(sun)
if (--dtrace_opens == 0)
if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL)
(void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE);
#else
--dtrace_opens;
@ -16806,7 +16806,11 @@ dtrace_dtr(void *data)
ASSERT(dtrace_opens > 0);
#if defined(sun)
if (--dtrace_opens == 0)
/*
* Only relinquish control of the kernel debugger interface when there
* are no consumers and no anonymous enablings.
*/
if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL)
(void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE);
#else
--dtrace_opens;