From cad735b5d08f7dea9a11140da94dd51412964c36 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 29 May 2006 13:28:37 +0000 Subject: [PATCH] test git-svn-id: http://ltt.polymtl.ca/svn@1865 04897980-b3bd-0310-b5e0-8ef037075253 --- tests/kernel/Makefile | 12 ++++++------ tests/kernel/test-cmpxchg.c | 33 ++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index a2985567..cd0e52e8 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -1,11 +1,11 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_LTT),) - obj-m += ltt-facility-loader-tests.o - obj-m += test-time-probe.o - obj-m += test-instrument-size-small.o - obj-m += test-instrument-size-med.o - obj-m += test-instrument-size-big.o - obj-m += test-printk-effect.o + #obj-m += ltt-facility-loader-tests.o + #obj-m += test-time-probe.o + #obj-m += test-instrument-size-small.o + #obj-m += test-instrument-size-med.o + #obj-m += test-instrument-size-big.o + #obj-m += test-printk-effect.o obj-m += test-cmpxchg.o endif diff --git a/tests/kernel/test-cmpxchg.c b/tests/kernel/test-cmpxchg.c index a8166331..16d56a51 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 -static volatile int test_val = 100; +volatile int test_val = 100; + static 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