Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
-CFLAGS=-Wall -O2 -g -I.
-#debug
-#CFLAGS=-Wall -g
+CFLAGS=-Wall -I.
+
+#optimized
+CFLAGS+=-O2
+
+#debug information
+CFLAGS+=-g
+
+#RCU debug (slower, with error-checks)
+#CFLAGS+=-DDEBUG_RCU
LDFLAGS=-lpthread
DEBUG_RCU is used to add internal debugging self-checks to the
RCU library. This define adds a performance penality when enabled.
+ Can be enabled by uncommenting the corresponding line in
+ Makefile.build.inc.
Usage of DEBUG_YIELD
#include <stdlib.h>
#include <pthread.h>
+#include <assert.h>
#include <compiler.h>
#include <arch.h>
*/
#define KICK_READER_LOOPS 10000
+#ifdef DEBUG_RCU
+#define rcu_assert(args...) assert(args)
+#else
+#define rcu_assert(args...)
+#endif
+
#ifdef DEBUG_YIELD
#include <sched.h>
#include <time.h>
static inline void _rcu_read_lock(void)
{
+ rcu_assert(rcu_reader_qs_gp & 1);
}
static inline void _rcu_read_unlock(void)