Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2011 23:29:32 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228448 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace security/mac sys
Message-ID:  <201112122329.pBCNTWL9023134@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Dec 12 23:29:32 2011
New Revision: 228448
URL: http://svn.freebsd.org/changeset/base/228448

Log:
  Revert the approach for skipping lockstat_probe_func call when doing
  lock_success/lock_failure, introduced in r228424, by directly skipping
  in dtrace_probe.
  
  This mainly helps in avoiding namespace pollution and thus lockstat.h
  dependency by systm.h.
  
  As an added bonus, this also helps in MFC case.
  Reviewed by:	avg
  MFC after:	3 months (or never)
  X-MFC:		r228424

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/security/mac/mac_priv.c
  head/sys/sys/lockstat.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Mon Dec 12 22:01:33 2011	(r228447)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Mon Dec 12 23:29:32 2011	(r228448)
@@ -5877,6 +5877,9 @@ dtrace_probe(dtrace_id_t id, uintptr_t a
 	volatile uint16_t *flags;
 	hrtime_t now;
 
+	if (panicstr != NULL)
+		return;
+
 #if defined(sun)
 	/*
 	 * Kick out immediately if this CPU is still being born (in which case

Modified: head/sys/security/mac/mac_priv.c
==============================================================================
--- head/sys/security/mac/mac_priv.c	Mon Dec 12 22:01:33 2011	(r228447)
+++ head/sys/security/mac/mac_priv.c	Mon Dec 12 23:29:32 2011	(r228448)
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_mac.h"
 
 #include <sys/param.h>
-#include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/priv.h>
 #include <sys/sdt.h>

Modified: head/sys/sys/lockstat.h
==============================================================================
--- head/sys/sys/lockstat.h	Mon Dec 12 22:01:33 2011	(r228447)
+++ head/sys/sys/lockstat.h	Mon Dec 12 23:29:32 2011	(r228448)
@@ -185,24 +185,17 @@ extern uint64_t lockstat_nsecs(void);
 #define	LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l)  do {   \
 	uint32_t id;							     \
 									     \
-	if (!SCHEDULER_STOPPED()) {					     \
-		lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt,  \
-		    f, l);						     \
-		if ((id = lockstat_probemap[(probe)]))			     \
-			(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0,    \
-			    0, 0);					     \
-	}								     \
+    	lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l);   \
+	if ((id = lockstat_probemap[(probe)])) 			     	     \
+		(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0);     \
 } while (0)
 
 #define	LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp)  do {			     \
 	uint32_t id;							     \
 									     \
-	if (!SCHEDULER_STOPPED()) {					     \
-		lock_profile_release_lock(&(lp)->lock_object);		     \
-		if ((id = lockstat_probemap[(probe)])) 		     	     \
-			(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0,    \
-			    0, 0);					     \
-	}								     \
+	lock_profile_release_lock(&(lp)->lock_object);			     \
+	if ((id = lockstat_probemap[(probe)])) 			     	     \
+		(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0);     \
 } while (0)
 
 #else	/* !KDTRACE_HOOKS */



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