convert from svn repository: remove tags directory
[lttv.git] / trunk / tests / markers / probe-direct.c
CommitLineData
bc82195a 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#include <linux/linkage.h>
15
16
17int value;
18void *ptr;
19
20/* function to install */
21#define DO_MARK1_FORMAT "%d %p"
22asmlinkage void do_mark1(const char *format, int pavalue, void *paptr)
23{
24 value = pavalue;
25 ptr = paptr;
26}
27
28int init_module(void)
29{
30 int result;
31 result = marker_set_probe("subsys_mark1", DO_MARK1_FORMAT,
32 (marker_probe_func*)do_mark1);
33 if(!result) goto end;
34
35 return 0;
36
37end:
38 marker_remove_probe((marker_probe_func*)do_mark1);
39 return -EPERM;
40}
41
42void cleanup_module(void)
43{
44 marker_remove_probe((marker_probe_func*)do_mark1);
45}
46
47MODULE_LICENSE("GPL");
48MODULE_AUTHOR("Mathieu Desnoyers");
49MODULE_DESCRIPTION("Probe");
This page took 0.031542 seconds and 4 git commands to generate.