From: compudj Date: Thu, 21 Sep 2006 15:41:43 +0000 (+0000) Subject: probe test X-Git-Tag: v0.12.20~1358 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3bb4bef88faa8857b10f687047932e0548f2d310;p=lttv.git probe test git-svn-id: http://ltt.polymtl.ca/svn@2131 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index 30bf09ef..60b38403 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -20,6 +20,7 @@ endif #obj-m += test-printk.o #obj-m += test-debugfs.o obj-m += test-mark.o + obj-m += probe.o #obj-m += marker-loader.o #obj-m += test-linuxtrace.o else diff --git a/tests/kernel/probe.c b/tests/kernel/probe.c new file mode 100644 index 00000000..96d9ff4d --- /dev/null +++ b/tests/kernel/probe.c @@ -0,0 +1,36 @@ +/* probe.c + * + * Loads a function at a marker call site. + * + * (C) Copyright 2006 Mathieu Desnoyers + * + * This file is released under the GPLv2. + * See the file COPYING for more details. + */ + +#include +#include +#include + +/* function to install */ +void do_mark1(const char *format, int value) +{ + printk("value is %d\n", value); +} + +int init_module(void) +{ + return marker_set_probe("subsys_mark1", (marker_probe)do_mark1, + MARKER_CALL); +} + +void cleanup_module(void) +{ + marker_disable_probe("subsys_mark1", (marker_probe)do_mark1, + MARKER_CALL); +} + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Mathieu Desnoyers"); +MODULE_DESCRIPTION("Probe"); +