probe test
[lttv.git] / tests / kernel / probe.c
CommitLineData
3bb4bef8 1/* probe.c
2 *
3 * Loads a function at a marker call site.
4 *
5 * (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
6 *
7 * This file is released under the GPLv2.
8 * See the file COPYING for more details.
9 */
10
11#include <linux/marker.h>
12#include <linux/module.h>
13#include <linux/kallsyms.h>
14
15/* function to install */
0efac34c 16#define DO_MARK1_FORMAT "%d"
2e871717 17asmlinkage void do_mark1(const char *format, int value)
3bb4bef8 18{
0efac34c 19 __mark_check_format(DO_MARK1_FORMAT, value);
3bb4bef8 20 printk("value is %d\n", value);
21}
22
23int init_module(void)
24{
0efac34c 25 return marker_set_probe("subsys_mark1", DO_MARK1_FORMAT,
26 (marker_probe_func*)do_mark1,
3bb4bef8 27 MARKER_CALL);
28}
29
30void cleanup_module(void)
31{
2e871717 32 marker_disable_probe("subsys_mark1", (marker_probe_func*)do_mark1,
3bb4bef8 33 MARKER_CALL);
34}
35
36MODULE_LICENSE("GPL");
37MODULE_AUTHOR("Mathieu Desnoyers");
38MODULE_DESCRIPTION("Probe");
39
This page took 0.023806 seconds and 4 git commands to generate.