X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Fkernel%2Ftest-cmpxchg.c;h=69a25334219fc9ef8ec275b3b266212ca740b3db;hb=abbd00d33b2bf48a80769dd0c40af8b60d1e59c0;hp=a81663319c6f3af32749fd126254ab8d146383bb;hpb=02e6c12634c5e4e473c5df88ba537502d046b882;p=lttv.git diff --git a/tests/kernel/test-cmpxchg.c b/tests/kernel/test-cmpxchg.c index a8166331..69a25334 100644 --- a/tests/kernel/test-cmpxchg.c +++ b/tests/kernel/test-cmpxchg.c @@ -4,24 +4,28 @@ */ +#include +#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 +36,25 @@ static int ltt_test_init(void) printk(KERN_ALERT "test init\n"); local_irq_save(flags); + time1 = get_cycles(); for(i=0; i