From: Mathieu Desnoyers Date: Mon, 9 Feb 2009 06:44:01 +0000 (-0500) Subject: Add rcutorture with yield X-Git-Tag: v0.1~309 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9b171f4656b61d023c327af3d0b4de22eee37353;p=userspace-rcu.git Add rcutorture with yield Signed-off-by: Mathieu Desnoyers --- diff --git a/Makefile b/Makefile index 566a942..4b5f24e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LDFLAGS=-lpthread SRC_DEP=`echo $^ | sed 's/[^ ]*.h//g'` all: test_urcu test_urcu_timing test_rwlock_timing test_urcu_yield urcu-asm.S \ - urcu-asm.o + urcu-asm.o urcutorture urcutorture-yield test_urcu: urcu.o test_urcu.c urcu.h $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP) @@ -33,10 +33,12 @@ urcu-asm.S: urcu-asm.c urcu.h urcu-asm.o: urcu-asm.c urcu.h $(CC) ${CFLAGS} -c -o $@ $(SRC_DEP) -#in progress... urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP) +urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h + $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP) + .PHONY: clean clean: diff --git a/rcutorture.h b/rcutorture.h index 7a19fed..bda2ad5 100644 --- a/rcutorture.h +++ b/rcutorture.h @@ -392,6 +392,11 @@ int main(int argc, char *argv[]) smp_init(); //rcu_init(); +#ifdef DEBUG_YIELD + yield_active |= YIELD_READ; + yield_active |= YIELD_WRITE; +#endif + if (argc > 1) { nreaders = strtoul(argv[1], NULL, 0); if (argc == 2) diff --git a/urcu.h b/urcu.h index fb8cedf..bc86d43 100644 --- a/urcu.h +++ b/urcu.h @@ -17,6 +17,7 @@ * Distributed under GPLv2 */ +#define __USE_GNU #include /* The "volatile" is due to gcc bugs */ @@ -109,6 +110,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, #ifdef DEBUG_YIELD #include +#include +#include #define YIELD_READ (1 << 0) #define YIELD_WRITE (1 << 1) diff --git a/urcutorture.c b/urcutorture.c index 7d672fd..258413a 100644 --- a/urcutorture.c +++ b/urcutorture.c @@ -3,6 +3,6 @@ #include #include #include -#include "urcu.h" #include "api.h" +#include "urcu.h" #include "rcutorture.h"