From: compudj Date: Wed, 20 Sep 2006 23:35:02 +0000 (+0000) Subject: test marker X-Git-Tag: v0.12.20~1359 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f8e77313452e934cf5d1af6f3659687126e992bc;p=lttv.git test marker git-svn-id: http://ltt.polymtl.ca/svn@2130 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index bd2ddc49..30bf09ef 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -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 index 00000000..7e2858eb --- /dev/null +++ b/tests/kernel/test-mark.c @@ -0,0 +1,44 @@ +/* test-mark.c + * + */ + +#include +#include +#include +#include + +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"); +