X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Fkernel%2Ftest-cmpxchg.c;h=58264a934999e0803df4a2379b4c398b03f6e139;hb=c9a9c80f3f62d7f187f02c3eafe8bb92aa2cf949;hp=a81663319c6f3af32749fd126254ab8d146383bb;hpb=02e6c12634c5e4e473c5df88ba537502d046b882;p=lttv.git diff --git a/tests/kernel/test-cmpxchg.c b/tests/kernel/test-cmpxchg.c index a8166331..58264a93 100644 --- a/tests/kernel/test-cmpxchg.c +++ b/tests/kernel/test-cmpxchg.c @@ -4,24 +4,27 @@ */ +#include +#include #include #include -#include -#include -#define NR_LOOPS 2000 +#define NR_LOOPS 20000 -static volatile int test_val = 100; +volatile int test_val = 100; -static void do_test(void) + +static inline void do_test(void) { - int val; + int val, ret; val = test_val; - ret = cmpxchg(&test_val, val, 101); + ret = cmpxchg(&test_val, val, val+1); } +//void (*fct)(void) = do_test; + static int ltt_test_init(void) { unsigned int i; @@ -32,22 +35,25 @@ static int ltt_test_init(void) printk(KERN_ALERT "test init\n"); local_irq_save(flags); + time1 = get_cycles(); for(i=0; i