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