From b07a83660bd7e021e662d2feced947dd2333f164 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 24 Jan 2016 01:01:11 +0000 Subject: [PATCH] Fix non-cpu counter build. --- sys/dev/lockstat.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/lockstat.h b/sys/dev/lockstat.h index f6029e8f9bc3..80e94f254433 100644 --- a/sys/dev/lockstat.h +++ b/sys/dev/lockstat.h @@ -1,4 +1,4 @@ -/* $NetBSD: lockstat.h,v 1.13 2015/03/09 01:41:41 christos Exp $ */ +/* $NetBSD: lockstat.h,v 1.14 2016/01/24 01:01:11 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -181,9 +181,6 @@ do { \ void lockstat_event(uintptr_t, uintptr_t, u_int, u_int, uint64_t); -extern volatile u_int lockstat_enabled; -extern volatile u_int lockstat_dev_enabled; - #else #define LOCKSTAT_FLAG(name) /* nothing */ @@ -216,9 +213,14 @@ void lockstat_probe_stub(uint32_t, uintptr_t, uintptr_t, #define KDTRACE_LOCKSTAT_ENABLED 0 #endif +#if defined(_KERNEL) && NLOCKSTAT > 0 +extern volatile u_int lockstat_enabled; +extern volatile u_int lockstat_dev_enabled; + #define LOCKSTAT_ENABLED_UPDATE() do { \ lockstat_enabled = lockstat_dev_enabled | KDTRACE_LOCKSTAT_ENABLED; \ membar_producer(); \ } while (/*CONSTCOND*/0) +#endif #endif /* _SYS_LOCKSTAT_H_ */