From 84c91edd5356f5693f0ecd74d787e98b52fee0b4 Mon Sep 17 00:00:00 2001 From: markj Date: Tue, 21 Jul 2015 17:16:37 +0000 Subject: MFC r285663, r285664, r285667: Ensure that locstat_nsecs() has no effect when lockstat probes are not enabled or when the profiled lock carries the LO_NOPROFILE flag. PR: 201642, 201517 Approved by: re (gjb) Tested by: Jason Unovitch --- sys/cddl/dev/lockstat/lockstat.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/cddl') diff --git a/sys/cddl/dev/lockstat/lockstat.c b/sys/cddl/dev/lockstat/lockstat.c index 9b3f7d7..bd7c812 100644 --- a/sys/cddl/dev/lockstat/lockstat.c +++ b/sys/cddl/dev/lockstat/lockstat.c @@ -161,6 +161,8 @@ lockstat_enable(void *arg, dtrace_id_t id, void *parg) ASSERT(!lockstat_probemap[probe->lsp_probe]); + lockstat_enabled++; + lockstat_probemap[probe->lsp_probe] = id; #ifdef DOODAD membar_producer(); @@ -184,6 +186,8 @@ lockstat_disable(void *arg, dtrace_id_t id, void *parg) ASSERT(lockstat_probemap[probe->lsp_probe]); + lockstat_enabled--; + lockstat_probemap[probe->lsp_probe] = 0; #ifdef DOODAD lockstat_hot_patch(); -- cgit v1.1