From cb0e02e00e9b1dd7c973b926616603c86ba314b7 Mon Sep 17 00:00:00 2001 From: attilio Date: Mon, 12 Dec 2011 23:29:32 +0000 Subject: [PATCH] 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 --- .../opensolaris/uts/common/dtrace/dtrace.c | 3 +++ sys/security/mac/mac_priv.c | 1 - sys/sys/lockstat.h | 19 ++++++------------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index ae243fd62dd3..ebba9837466f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -5877,6 +5877,9 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, 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 diff --git a/sys/security/mac/mac_priv.c b/sys/security/mac/mac_priv.c index f184a6838b0c..537c00288298 100644 --- a/sys/security/mac/mac_priv.c +++ b/sys/security/mac/mac_priv.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "opt_mac.h" #include -#include #include #include #include diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h index bdfb475cfc0e..ed9cffa92b62 100644 --- a/sys/sys/lockstat.h +++ b/sys/sys/lockstat.h @@ -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 */