From: Pierre-Marc Fournier Date: Wed, 18 Feb 2009 23:10:32 +0000 (-0500) Subject: ust: add userspace rcu support X-Git-Tag: v1.9.1~1059 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=09938485689f3482ec845e52d5bf5e78c1093e27;p=lttng-ust.git ust: add userspace rcu support --- diff --git a/hello/Makefile b/hello/Makefile index 4168e6e6..62f4c653 100644 --- a/hello/Makefile +++ b/hello/Makefile @@ -2,10 +2,8 @@ all: hello hello: hello.c #dynamic version - gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -lmarkers -L../libtracectl -ltracectl -L../libtracing -ltracing -o hello hello.c marker-control.c serialize.c + gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -lmarkers -L../libtracectl -ltracectl -L../libtracing -ltracing -I../../../../urcu -Wl,-rpath ../../../../urcu -o hello hello.c marker-control.c serialize.c # -Wl,--print-map -#static version -# gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -o hello hello.c marker-control.c serialize.c ../libtracing/*.c ../libmarkers/*.c ../libtracectl/*.c ../share/*.c clean: rm -rf hello *.o diff --git a/libmarkers/Makefile b/libmarkers/Makefile index d3729f8f..bf5539aa 100644 --- a/libmarkers/Makefile +++ b/libmarkers/Makefile @@ -1,6 +1,6 @@ all: libmarkers.so libmarkers.so: marker.c *.c *.h - gcc -g -fPIC -I../share -I../libtracing -I. -shared -o libmarkers.so marker.c ../share/kref.c ../libtracing/channels.c + gcc -g -fPIC -I../share -I../libtracing -I. -shared -o libmarkers.so -L../../../../urcu -I../../../../urcu $(CFLAGS) -lurcu marker.c ../share/kref.c ../libtracing/channels.c .PHONY: libmarkers.so all diff --git a/libmarkers/marker.c b/libmarkers/marker.c index 198650b3..e1b62c7f 100644 --- a/libmarkers/marker.c +++ b/libmarkers/marker.c @@ -817,6 +817,7 @@ int marker_probe_register(const char *channel, const char *name, /* write rcu_pending before calling the RCU callback */ smp_wmb(); call_rcu_sched(&entry->rcu, free_old_closure); + /*synchronize_rcu(); free_old_closure();*/ goto end; error_unregister_channel: diff --git a/libtracectl/Makefile b/libtracectl/Makefile index 6aa41e46..27803da2 100644 --- a/libtracectl/Makefile +++ b/libtracectl/Makefile @@ -1,7 +1,7 @@ all: libtracectl.so libtracectl.so: tracectl.c - gcc -g -shared -fPIC -I../libmarkers -I../share -o libtracectl.so tracectl.c + gcc -g -shared -fPIC -I../libmarkers -I../share $(CFLAGS) -o libtracectl.so tracectl.c clean: rm -rf *.so *.o diff --git a/libtracing/Makefile b/libtracing/Makefile index b2904e85..d8abbbbe 100644 --- a/libtracing/Makefile +++ b/libtracing/Makefile @@ -1,6 +1,6 @@ all: libtracing.so libtracing.so: *.c *.h - gcc -g -fPIC -I../share -I../libtracing -I../libmarkers -shared -o libtracing.so *.c + gcc -g -fPIC -I../share -I../libtracing -I../libmarkers $(CFLAGS) -shared -o libtracing.so *.c .PHONY: libtracing.so all diff --git a/share/kernelcompat.h b/share/kernelcompat.h index 9139e752..f95d0d77 100644 --- a/share/kernelcompat.h +++ b/share/kernelcompat.h @@ -98,21 +98,21 @@ typedef int spinlock_t; /* MEMORY BARRIERS */ -#define smp_rmb() do {} while(0) -#define smp_wmb() do {} while(0) -#define smp_mb() do {} while(0) +//#define smp_rmb() do {} while(0) +//#define smp_wmb() do {} while(0) +//#define smp_mb() do {} while(0) #define smp_mb__after_atomic_inc() do {} while(0) #define read_barrier_depends() do {} while(0) -#define smp_read_barrier_depends() do {} while(0) +//#define smp_read_barrier_depends() do {} while(0) /* RCU */ -#define rcu_assign_pointer(a, b) do {} while(0) -#define call_rcu_sched(a,b) do {} while(0) -#define rcu_barrier_sched() do {} while(0) -#define rcu_read_lock_sched_notrace() do{} while (0) -#define rcu_read_unlock_sched_notrace() do{} while (0) +#include "urcu.h" +#define call_rcu_sched(a,b) b(a); synchronize_rcu() +#define rcu_barrier_sched() do {} while(0) /* this nop is ok if call_rcu_sched does a synchronize_rcu() */ +#define rcu_read_lock_sched_notrace() rcu_read_lock() +#define rcu_read_unlock_sched_notrace() rcu_read_unlock() /* ATOMICITY */ @@ -147,7 +147,7 @@ static int atomic_read(atomic_t *p) #include "asm.h" -#define __xg(x) ((volatile long *)(x)) +//#define __xg(x) ((volatile long *)(x)) #define cmpxchg(ptr, o, n) \ ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \