release script
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 5 Jun 2006 03:00:46 +0000 (03:00 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 5 Jun 2006 03:00:46 +0000 (03:00 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1892 04897980-b3bd-0310-b5e0-8ef037075253

scripts/lttng-split-script.sh
tests/kernel/Makefile
tests/kernel/test-spinlock.c [new file with mode: 0644]

index d16b8af8cfcd30574f56e8bfa5862cdba154245e..db76f1b7d64e47632392e400eaea181b01c2a97d 100755 (executable)
@@ -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
index c134b33702fb03ebc8441b56b2662329a35babef..3adfaf2390e47f604bf137520ece55636174676b 100644 (file)
@@ -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 (file)
index 0000000..42d4bdb
--- /dev/null
@@ -0,0 +1,77 @@
+/* test-cmpxchg.c
+ *
+ * Test time spent in a LTTng instrumentation probe.
+ */
+
+
+#include <linux/config.h>
+#include <linux/jiffies.h>
+#include <linux/compiler.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+
+#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<NR_LOOPS; i++) {
+               //for(int j=0; j<10; j++) {
+               do_test();
+               //}
+               //max_time = max(max_time, time);
+               //min_time = min(min_time, time);
+               //printk("val : %d\n", test_val);
+       }
+       time2 = get_cycles();
+       local_irq_restore(flags);
+       time = time2 - time1;
+       tot_time += time;
+
+       printk(KERN_ALERT "test results : time for spinlock irqsave\n");
+       printk(KERN_ALERT "number of loops : %d\n", NR_LOOPS);
+       printk(KERN_ALERT "total time : %llu\n", tot_time);
+       //printk(KERN_ALERT "min : %llu\n", min_time);
+       //printk(KERN_ALERT "max : %llu\n", max_time);
+
+       printk(KERN_ALERT "test end\n");
+       
+       return -EAGAIN; /* Fail will directly unload the module */
+}
+
+static void ltt_test_exit(void)
+{
+       printk(KERN_ALERT "test exit\n");
+}
+
+module_init(ltt_test_init)
+module_exit(ltt_test_exit)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("Linux Trace Toolkit Test");
+
This page took 0.025458 seconds and 4 git commands to generate.