1 #ifndef _LTT_WRAPPER_FTRACE_H
2 #define _LTT_WRAPPER_FTRACE_H
5 * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
7 * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
8 * available, else we need to have a kernel that exports this function to GPL
11 * Dual LGPL v2.1/GPL v2 license.
14 #include <linux/ftrace.h>
16 #ifdef CONFIG_KALLSYMS
18 #include <linux/kallsyms.h>
21 int wrapper_register_ftrace_function_probe(char *glob
,
22 struct ftrace_probe_ops
*ops
, void *data
)
24 int (*register_ftrace_function_probe_sym
)(char *glob
,
25 struct ftrace_probe_ops
*ops
, void *data
);
27 register_ftrace_function_probe_sym
= (void *) kallsyms_lookup_name("register_ftrace_function_probe");
28 if (register_ftrace_function_probe_sym
) {
29 return register_ftrace_function_probe_sym(glob
, ops
, data
);
31 printk(KERN_WARNING
"LTTng: register_ftrace_function_probe symbol lookup failed.\n");
37 void wrapper_unregister_ftrace_function_probe(char *glob
,
38 struct ftrace_probe_ops
*ops
, void *data
)
40 void (*unregister_ftrace_function_probe_sym
)(char *glob
,
41 struct ftrace_probe_ops
*ops
, void *data
);
43 unregister_ftrace_function_probe_sym
= (void *) kallsyms_lookup_name("unregister_ftrace_function_probe");
44 if (unregister_ftrace_function_probe_sym
) {
45 unregister_ftrace_function_probe_sym(glob
, ops
, data
);
47 printk(KERN_WARNING
"LTTng: unregister_ftrace_function_probe symbol lookup failed.\n");
55 int wrapper_register_ftrace_function_probe(char *glob
,
56 struct ftrace_probe_ops
*ops
, void *data
)
58 return unregister_ftrace_function_probe();
62 void wrapper_unregister_ftrace_function_probe(char *glob
,
63 struct ftrace_probe_ops
*ops
, void *data
)
65 return unregister_ftrace_function_probe();
69 #endif /* _LTT_WRAPPER_FTRACE_H */