From 1a43bbd8f98d5dcf1404b16ab4dc4bfddd65c3b0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 9 Oct 2009 10:23:09 -0400 Subject: [PATCH] Update rcutorture: test all RCU flavors Signed-off-by: Mathieu Desnoyers --- tests/Makefile.am | 29 ++++++++++++++++++++++------- tests/api_gcc.h | 4 ++++ tests/api_ppc.h | 3 +++ tests/api_x86.h | 3 +++ tests/rcutorture.h | 6 ++++++ tests/urcutorture.c | 14 ++++++++++++++ 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 748e770..a4c30ff 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,13 +4,13 @@ AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \ test_rwlock_timing test_rwlock test_perthreadlock_timing \ test_perthreadlock test_urcu_yield test_urcu_mb \ - test_qsbr_timing test_qsbr urcutorture \ - urcutorture-yield test_mutex test_looplen test_urcu_gc \ + test_qsbr_timing test_qsbr rcutorture_urcu \ + rcutorture_urcu_mb rcutorture_urcu_bp rcutorture_qsbr \ + test_mutex test_looplen test_urcu_gc \ test_urcu_gc_mb test_qsbr_gc test_qsbr_lgc test_urcu_lgc \ test_urcu_lgc_mb test_qsbr_dynamic_link test_urcu_mb_defer \ test_uatomic test_urcu_assign test_urcu_assign_dynamic_link \ test_urcu_bp test_urcu_bp_dynamic_link - noinst_HEADERS = rcutorture.h if COMPAT_ARCH @@ -33,6 +33,10 @@ URCU_QSBR=$(top_builddir)/urcu-qsbr.c $(top_builddir)/urcu-pointer.c $(COMPAT) # -DURCU_MB must be defined URCU_MB_DEFER=$(top_builddir)/urcu.c $(top_builddir)/urcu-defer.c $(top_builddir)/urcu-pointer.c $(COMPAT) +URCU_SIGNAL_LIB=$(top_builddir)/liburcu.la +URCU_MB_LIB=$(top_builddir)/liburcu-mb.la +URCU_BP_LIB=$(top_builddir)/liburcu-bp.la +URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la if GCC_API APIHEADER=api_gcc.h @@ -68,10 +72,21 @@ test_qsbr_timing_SOURCES = test_qsbr_timing.c $(URCU_QSBR) test_qsbr_SOURCES = test_qsbr.c $(URCU_QSBR) -urcutorture_SOURCES = api.h urcutorture.c $(URCU_SIGNAL) +rcutorture_urcu_SOURCES = api.h urcutorture.c +rcutorture_urcu_CFLAGS = -DTORTURE_URCU_SIGNAL $(AM_CFLAGS) +rcutorture_urcu_LDADD = $(URCU_SIGNAL_LIB) + +rcutorture_urcu_mb_SOURCES = api.h urcutorture.c +rcutorture_urcu_mb_CFLAGS = -DTORTURE_URCU_MB $(AM_CFLAGS) +rcutorture_urcu_mb_LDADD = $(URCU_MB_LIB) + +rcutorture_qsbr_SOURCES = api.h urcutorture.c +rcutorture_qsbr_CFLAGS = -DTORTURE_QSBR $(AM_CFLAGS) +rcutorture_qsbr_LDADD = $(URCU_QSBR_LIB) -urcutorture_yield_SOURCES = api.h urcutorture.c $(URCU_SIGNAL_YIELD) -urcutorture_yield_CFLAGS = -DDEBUG_YIELD $(AM_CFLAGS) +rcutorture_urcu_bp_SOURCES = api.h urcutorture.c +rcutorture_urcu_bp_CFLAGS = -DTORTURE_URCU_BP $(AM_CFLAGS) +rcutorture_urcu_bp_LDADD = $(URCU_BP_LIB) test_mutex_SOURCES = test_mutex.c $(URCU_SIGNAL) @@ -111,7 +126,7 @@ test_urcu_bp_SOURCES = test_urcu_bp.c $(URCU_BP) test_urcu_bp_dynamic_link_SOURCES = test_urcu_bp.c $(URCU_BP) test_urcu_bp_dynamic_link_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS) -urcutorture.o: api.h +*.o: api.h api.h: $(APIHEADER) cp -f $(srcdir)/$(APIHEADER) api.h diff --git a/tests/api_gcc.h b/tests/api_gcc.h index b31f3fc..872c873 100644 --- a/tests/api_gcc.h +++ b/tests/api_gcc.h @@ -1,3 +1,5 @@ + +#ifndef _INCLUDE_API_H #define _INCLUDE_API_H /* @@ -1330,3 +1332,5 @@ static inline void hlist_move_list(struct hlist_head *old, pos = n) #endif + +#endif diff --git a/tests/api_ppc.h b/tests/api_ppc.h index 3ca5270..18821e4 100644 --- a/tests/api_ppc.h +++ b/tests/api_ppc.h @@ -1,5 +1,6 @@ /* MECHANICALLY GENERATED, DO NOT EDIT!!! */ +#ifndef _INCLUDE_API_H #define _INCLUDE_API_H /* @@ -1704,3 +1705,5 @@ static inline void hlist_move_list(struct hlist_head *old, pos = n) #endif + +#endif diff --git a/tests/api_x86.h b/tests/api_x86.h index 4f6e836..05fc05a 100644 --- a/tests/api_x86.h +++ b/tests/api_x86.h @@ -1,5 +1,6 @@ /* MECHANICALLY GENERATED, DO NOT EDIT!!! */ +#ifndef _INCLUDE_API_H #define _INCLUDE_API_H /* @@ -1393,3 +1394,5 @@ static inline void hlist_move_list(struct hlist_head *old, pos = n) #endif + +#endif diff --git a/tests/rcutorture.h b/tests/rcutorture.h index 712d59d..181547a 100644 --- a/tests/rcutorture.h +++ b/tests/rcutorture.h @@ -92,6 +92,12 @@ int goflag __attribute__((__aligned__(CACHE_LINE_SIZE))) = GOFLAG_INIT; #define rcu_read_unlock_nest() #endif /* #else #ifdef RCU_READ_NESTABLE */ +#ifdef TORTURE_QSBR +#define mark_rcu_quiescent_state rcu_quiescent_state +#define put_thread_offline rcu_thread_offline +#define put_thread_online rcu_thread_online +#endif + #ifndef mark_rcu_quiescent_state #define mark_rcu_quiescent_state() do ; while (0) #endif /* #ifdef mark_rcu_quiescent_state */ diff --git a/tests/urcutorture.c b/tests/urcutorture.c index 7e38606..929d171 100644 --- a/tests/urcutorture.c +++ b/tests/urcutorture.c @@ -6,7 +6,21 @@ #include #include "api.h" #define _LGPL_SOURCE + +#ifdef TORTURE_URCU_SIGNAL #include +#endif +#ifdef TORTURE_URCU_MB +#define URCU_MB +#include +#endif +#ifdef TORTURE_QSBR +#include +#endif +#ifdef TORTURE_URCU_BP +#include +#endif + #include #include #include "rcutorture.h" -- 2.34.1