Syscall detail mode: generate syscall table
[lttng-modules.git] / probes / lttng-probe-syscalls.c
1 /*
2 * probes/lttng-probe-sched.c
3 *
4 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 *
6 * LTTng sched probes.
7 *
8 * Dual LGPL v2.1/GPL v2 license.
9 */
10
11 #include <linux/module.h>
12
13 #ifndef SYSCALL_DETAIL
14
15 /*
16 * Create the tracepoint static inlines from the kernel to validate that our
17 * trace event macros match the kernel we run on.
18 */
19 #include <trace/events/syscalls.h>
20
21 /*
22 * Create LTTng tracepoint probes.
23 */
24 #define LTTNG_PACKAGE_BUILD
25 #define CREATE_TRACE_POINTS
26 #define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module
27
28 #include "../instrumentation/events/lttng-module/syscalls.h"
29
30 #else /* SYSCALL_DETAIL */
31
32 /*
33 * Create LTTng tracepoint probes.
34 */
35 #define LTTNG_PACKAGE_BUILD
36 #define CREATE_TRACE_POINTS
37
38 #define TRACE_INCLUDE_PATH ../instrumentation/syscalls/headers
39
40 #define TRACE_SYSCALL_TABLE(_name, _nr, _nrargs)
41
42 #include "../instrumentation/syscalls/headers/syscalls.h"
43
44 #undef LTTNG_PACKAGE_BUILD
45 #undef CREATE_TRACE_POINTS
46
47 struct trace_syscall_entry {
48 void *func;
49 unsigned int nrargs;
50 };
51
52 #define CREATE_SYSCALL_TABLE
53
54 #undef TRACE_SYSCALL_TABLE
55 #define TRACE_SYSCALL_TABLE(_name, _nr, _nrargs) \
56 [ _nr ] = { .func = __event_probe__##_name, .nrargs = (_nrargs) },
57
58 static struct trace_syscall_entry sc_table[] = {
59 #include "../instrumentation/syscalls/headers/syscalls.h"
60 };
61 #undef CREATE_SYSCALL_TABLE
62
63 #endif /* SYSCALL_DETAIL */
64
65 MODULE_LICENSE("GPL and additional rights");
66 MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
67 MODULE_DESCRIPTION("LTTng sched probes");
This page took 0.032124 seconds and 4 git commands to generate.