Commit | Line | Data |
---|---|---|
ae3dd5f0 MD |
1 | /* |
2 | * probes/lttng-probe-sched.c | |
3 | * | |
4 | * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
5 | * | |
6 | * LTTng sched probes. | |
17baffe2 MD |
7 | * |
8 | * Dual LGPL v2.1/GPL v2 license. | |
ae3dd5f0 MD |
9 | */ |
10 | ||
11 | #include <linux/module.h> | |
12 | ||
054f2ed3 MD |
13 | #ifndef SYSCALL_DETAIL |
14 | ||
ae3dd5f0 MD |
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 | */ | |
705e0807 | 19 | #include <trace/events/syscalls.h> |
ae3dd5f0 MD |
20 | |
21 | /* | |
22 | * Create LTTng tracepoint probes. | |
23 | */ | |
24 | #define LTTNG_PACKAGE_BUILD | |
25 | #define CREATE_TRACE_POINTS | |
d5869321 | 26 | #define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module |
ae3dd5f0 | 27 | |
d5869321 | 28 | #include "../instrumentation/events/lttng-module/syscalls.h" |
ae3dd5f0 | 29 | |
054f2ed3 MD |
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 | ||
ae3dd5f0 MD |
65 | MODULE_LICENSE("GPL and additional rights"); |
66 | MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>"); | |
67 | MODULE_DESCRIPTION("LTTng sched probes"); |