add tests
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 29 Mar 2006 16:28:46 +0000 (16:28 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 29 Mar 2006 16:28:46 +0000 (16:28 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1727 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/Makefile [new file with mode: 0644]
tests/kernel/module-template.c [new file with mode: 0644]
tests/kernel/test-time-probe.c [new file with mode: 0644]

diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile
new file mode 100644 (file)
index 0000000..e971a88
--- /dev/null
@@ -0,0 +1,24 @@
+ifneq ($(KERNELRELEASE),)
+ifneq ($(CONFIG_LTT),)
+       obj-m := test-time-probe.o test-l1-hit-probe.o test-int-response.o test-instrument-size-small.o test-instrument-size-med.o test-instrument-size-big.o test-time-precision.o
+endif
+
+else
+       KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+       PWD := $(shell pwd)
+       KERNELRELEASE = $(shell cat $(KERNELDIR)/$(KBUILD_OUTPUT)/include/linux/version.h | sed -n 's/.*UTS_RELEASE.*\"\(.*\)\".*/\1/p')
+ifneq ($(INSTALL_MOD_PATH),)
+       DEPMOD_OPT := -b $(INSTALL_MOD_PATH)
+endif
+
+default:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+modules_install:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
+       if [ -f $(KERNELDIR)/$(KBUILD_OUTPUT)/System.map ] ; then /sbin/depmod -ae -F $(KERNELDIR)/$(KBUILD_OUTPUT)/System.map $(DEPMOD_OPT) $(KERNELRELEASE) ; fi
+
+
+clean:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+endif
diff --git a/tests/kernel/module-template.c b/tests/kernel/module-template.c
new file mode 100644 (file)
index 0000000..29f870b
--- /dev/null
@@ -0,0 +1,29 @@
+/* test-time-probe.c
+ *
+ * Test time spent in a LTTng instrumentation probe.
+ */
+
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/ltt-core.h>
+
+static int ltt_test_init(void)
+{
+       printk(KERN_ALERT "test init\n");
+
+       return 0;
+}
+
+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");
+
diff --git a/tests/kernel/test-time-probe.c b/tests/kernel/test-time-probe.c
new file mode 100644 (file)
index 0000000..29f870b
--- /dev/null
@@ -0,0 +1,29 @@
+/* test-time-probe.c
+ *
+ * Test time spent in a LTTng instrumentation probe.
+ */
+
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/ltt-core.h>
+
+static int ltt_test_init(void)
+{
+       printk(KERN_ALERT "test init\n");
+
+       return 0;
+}
+
+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.024679 seconds and 4 git commands to generate.