From c2bf1ace334f7d30f9ccca39254997112f8e229b Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 5 Jun 2006 03:00:46 +0000 Subject: [PATCH] release script git-svn-id: http://ltt.polymtl.ca/svn@1892 04897980-b3bd-0310-b5e0-8ef037075253 --- scripts/lttng-split-script.sh | 5 +++ tests/kernel/Makefile | 3 ++ tests/kernel/test-spinlock.c | 77 +++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 tests/kernel/test-spinlock.c diff --git a/scripts/lttng-split-script.sh b/scripts/lttng-split-script.sh index d16b8af8..db76f1b7 100755 --- a/scripts/lttng-split-script.sh +++ b/scripts/lttng-split-script.sh @@ -151,8 +151,11 @@ FILE=../$NAME-facilities-headers.diff IN="?_include_linux_ltt_ltt-facility-core.h ?_include_linux_ltt_ltt-facility-fs.h +?_include_linux_ltt_ltt-facility-fs_data.h +?_include_linux_ltt_ltt-facility-custom-fs_data.h ?_include_linux_ltt_ltt-facility-id-core.h ?_include_linux_ltt_ltt-facility-id-fs.h +?_include_linux_ltt_ltt-facility-id-fs_data.h ?_include_linux_ltt_ltt-facility-id-ipc.h ?_include_linux_ltt_ltt-facility-id-kernel.h ?_include_linux_ltt_ltt-facility-id-locking.h @@ -196,6 +199,8 @@ IN="?_ltt_Makefile ?_ltt_ltt-facility-loader-core.h ?_ltt_ltt-facility-loader-fs.c ?_ltt_ltt-facility-loader-fs.h +?_ltt_ltt-facility-loader-fs_data.c +?_ltt_ltt-facility-loader-fs_data.h ?_ltt_ltt-facility-loader-ipc.c ?_ltt_ltt-facility-loader-ipc.h ?_ltt_ltt-facility-loader-kernel.c diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index c134b337..3adfaf23 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -10,6 +10,9 @@ ifneq ($(CONFIG_LTT),) endif obj-m += test-cmpxchg.o obj-m += test-cmpxchg-nolock.o + obj-m += test-spinlock.o + obj-m += test-inc.o + obj-m += test-inc-nolock.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build diff --git a/tests/kernel/test-spinlock.c b/tests/kernel/test-spinlock.c new file mode 100644 index 00000000..42d4bdb3 --- /dev/null +++ b/tests/kernel/test-spinlock.c @@ -0,0 +1,77 @@ +/* test-cmpxchg.c + * + * Test time spent in a LTTng instrumentation probe. + */ + + +#include +#include +#include +#include +#include +#include + +#define NR_LOOPS 20000 + +volatile int test_val = 100; + +spinlock_t lock = SPIN_LOCK_UNLOCKED; + +static inline void do_test(void) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + test_val += 1; + spin_unlock_irqrestore(&lock, flags); +} + +//void (*fct)(void) = do_test; + +static int ltt_test_init(void) +{ + unsigned int i; + cycles_t time1, time2, time; + cycles_t max_time = 0, min_time = 18446744073709551615ULL; /* (2^64)-1 */ + cycles_t tot_time = 0; + unsigned long flags; + printk(KERN_ALERT "test init\n"); + + local_irq_save(flags); + time1 = get_cycles(); + for(i=0; i