summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--sys/arch/i386/conf/LOCKDOC2
-rw-r--r--sys/arch/x86/include/cpufunc.h11
-rw-r--r--sys/lockdoc/log.c8
-rw-r--r--sys/sys/lockdoc.h6
-rw-r--r--sys/sys/lockdoc_event.h4
6 files changed, 17 insertions, 15 deletions
diff --git a/TODO b/TODO
index 8c1498ada03..a0ab1197c06 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-- Separate LOCKDEBUG from LOCKDOC kernel opt
- SMP
- IRQ
- Implement all lock types
diff --git a/sys/arch/i386/conf/LOCKDOC b/sys/arch/i386/conf/LOCKDOC
index d7d2d0f7efe..7920a133061 100644
--- a/sys/arch/i386/conf/LOCKDOC
+++ b/sys/arch/i386/conf/LOCKDOC
@@ -113,6 +113,8 @@ options BUFQ_PRIOCSCAN
# XXX to be commented out on release branch
options DEBUG # expensive debugging checks/support
options LOCKDEBUG # expensive locking checks/support. Also triggers LOCKDOC experiments
+makeoptions LOCKDOC=1
+options LOCKDOC
#options DDB # in-kernel debugger
#options DDB_ONPANIC=1 # see also sysctl(7): `ddb.onpanic'
#options DDB_HISTORY_SIZE=512 # enable history editing in DDB
diff --git a/sys/arch/x86/include/cpufunc.h b/sys/arch/x86/include/cpufunc.h
index 8b216c21fcf..8a4e7a7c0a0 100644
--- a/sys/arch/x86/include/cpufunc.h
+++ b/sys/arch/x86/include/cpufunc.h
@@ -45,7 +45,6 @@
#ifdef _KERNEL
#if defined(_KERNEL_OPT)
#include "opt_xen.h"
-#include "opt_lockdebug.h"
#endif
static inline void
@@ -569,7 +568,8 @@ void x86_disable_intr(void);
void x86_enable_intr(void);
#else
-#ifdef LOCKDEBUG
+#ifdef LOCKDOC
+
#define x86_disable_intr() __x86_disable_intr(__FILE__, __LINE__, __func__)
void __x86_disable_intr(const char *file, int line, const char *func);
@@ -579,14 +579,15 @@ static __inline void lockdoc_x86_disable_intr(void)
}
#else
+
static inline void
x86_disable_intr(void)
{
__asm volatile ("cli" ::: "memory");
}
-#endif /* LOCKDEBUG */
+#endif /* LOCKDOC */
-#ifdef LOCKDEBUG
+#ifdef LOCKDOC
#define x86_enable_intr() __x86_enable_intr(__FILE__, __LINE__, __func__)
void __x86_enable_intr(const char *file, int line, const char *func);
@@ -601,7 +602,7 @@ x86_enable_intr(void)
{
__asm volatile ("sti" ::: "memory");
}
-#endif /* LOCKDEBUG */
+#endif /* LOCKDOC */
#endif /* XENPV */
diff --git a/sys/lockdoc/log.c b/sys/lockdoc/log.c
index 91d2a8d02cb..52d5115da41 100644
--- a/sys/lockdoc/log.c
+++ b/sys/lockdoc/log.c
@@ -1,22 +1,18 @@
#include <arch/x86/include/cpufunc.h>
#include <sys/lockdoc.h>
-#include "opt_lockdebug.h"
-
-#ifdef LOCKDEBUG
+#ifdef LOCKDOC
struct log_action la_buffer;
void __x86_disable_intr(const char *file, int line, const char *func){
// TODO Actually log things
lockdoc_x86_disable_intr();
- __asm __volatile("cli" : : : "memory");
}
void __x86_enable_intr(const char *file, int line, const char *func){
// TODO Actually log things
lockdoc_x86_enable_intr();
- __asm __volatile ("sti" ::: "memory");
}
-#endif /* LOCKDEBUG */ \ No newline at end of file
+#endif /* LOCKDOC */ \ No newline at end of file
diff --git a/sys/sys/lockdoc.h b/sys/sys/lockdoc.h
index e6b666540d5..7c265707ed4 100644
--- a/sys/sys/lockdoc.h
+++ b/sys/sys/lockdoc.h
@@ -11,7 +11,7 @@
#define MK_STRING(x) #x
#define IO_PORT_LOG (0x00e9)
-#ifdef LOCKDEBUG
+#ifdef LOCKDOC
extern struct log_action la_buffer;
@@ -72,6 +72,6 @@ static inline void log_lock(int lock_op, const void* ptr, const char *file, int
#else
#define log_lock(a, b, c, d, e)
-#endif // !LOCKDEBUG
+#endif /* LOCKDOC */
-#endif // __LOCKDOC_H__
+#endif /* __LOCKDOC_H__ */
diff --git a/sys/sys/lockdoc_event.h b/sys/sys/lockdoc_event.h
index 8552cb9bd18..e9f596f7a71 100644
--- a/sys/sys/lockdoc_event.h
+++ b/sys/sys/lockdoc_event.h
@@ -1,6 +1,8 @@
#ifndef __LOCKDOC_EVENT_H__
#define __LOCKDOC_EVENT_H__
+#ifdef LOCKDOC
+
#define LOG_CHAR_BUFFER_LEN 100
#define PSEUDOLOCK_ADDR_RCU 0x42
#define PSEUDOLOCK_ADDR_PREEMPT 0x43
@@ -65,4 +67,6 @@ struct log_action {
int32_t flags;
}__attribute__((packed));
+#endif /* LOCKDOC */
+
#endif /* __LOCKDOC_EVENT_H__ */