From 3bb4bef88faa8857b10f687047932e0548f2d310 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 21 Sep 2006 15:41:43 +0000 Subject: [PATCH] probe test git-svn-id: http://ltt.polymtl.ca/svn@2131 04897980-b3bd-0310-b5e0-8ef037075253 --- tests/kernel/Makefile | 1 + tests/kernel/probe.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/kernel/probe.c 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"); + -- 2.34.1