test marker
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 20 Sep 2006 23:35:02 +0000 (23:35 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 20 Sep 2006 23:35:02 +0000 (23:35 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2130 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/Makefile
tests/kernel/test-mark.c [new file with mode: 0644]

index bd2ddc49f9c8d76a8fd2c81632969bc052e0c41c..30bf09ef3a625c8b2df02f4cde4e8410a9815252 100644 (file)
@@ -16,7 +16,12 @@ endif
 #      obj-m += test-kmalloc.o
 #      obj-m += test-irqdis.o
 #      obj-m += test-int3.o
-       obj-m += test-kprobes.o
+       #obj-m += test-kprobes.o
+       #obj-m += test-printk.o
+       #obj-m += test-debugfs.o
+       obj-m += test-mark.o
+       #obj-m += marker-loader.o
+       #obj-m += test-linuxtrace.o
 else
        KERNELDIR ?= /lib/modules/$(shell uname -r)/build
        PWD := $(shell pwd)
diff --git a/tests/kernel/test-mark.c b/tests/kernel/test-mark.c
new file mode 100644 (file)
index 0000000..7e2858e
--- /dev/null
@@ -0,0 +1,44 @@
+/* test-mark.c
+ *
+ */
+
+#include <linux/marker.h>
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/sched.h>
+
+int x=7;
+
+struct proc_dir_entry *pentry = NULL;
+
+static int my_open(struct inode *inode, struct file *file)
+{
+       MARK(subsys_mark1, "%d", 1);
+       MARK(subsys_mark2, "%d %s", 2, "blah2");
+       MARK(subsys_mark3, "%d %s", x, "blah3");
+
+       return -EPERM;
+}
+
+
+static struct file_operations my_operations = {
+        .open = my_open,
+};
+
+int init_module(void)
+{
+       pentry = create_proc_entry("testmark", 0444, NULL);
+        if(pentry)
+                pentry->proc_fops = &my_operations;
+       return 0;
+}
+
+void cleanup_module(void)
+{
+       remove_proc_entry("testmark", NULL);
+}
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("Marker Test");
+
This page took 0.024725 seconds and 4 git commands to generate.