2 * lttng-compat-syscalls.c
4 * Copyright 2010-2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * LTTng compat syscall probes.
8 * Dual LGPL v2.1/GPL v2 license.
11 #include <linux/module.h>
12 #include <linux/slab.h>
13 #include <linux/compat.h>
14 #include <asm/ptrace.h>
15 #include <asm/syscall.h>
17 #include "ltt-events.h"
20 void syscall_entry_probe(void *__data
, struct pt_regs
*regs
, long id
);
23 * Take care of NOARGS not supported by mainline.
25 #define DECLARE_EVENT_CLASS_NOARGS(name, tstruct, assign, print)
26 #define DEFINE_EVENT_NOARGS(template, name)
27 #define TRACE_EVENT_NOARGS(name, struct, assign, print)
30 * Create LTTng tracepoint probes.
32 #define LTTNG_PACKAGE_BUILD
33 #define CREATE_TRACE_POINTS
34 #define TP_MODULE_OVERRIDE
35 #define TRACE_INCLUDE_PATH ../instrumentation/syscalls/headers
37 /* Hijack probe callback for system calls */
38 #define TP_PROBE_CB(_template) &syscall_entry_probe
39 #include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
40 #include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
43 #undef TP_MODULE_OVERRIDE
44 #undef LTTNG_PACKAGE_BUILD
45 #undef CREATE_TRACE_POINTS
47 #undef TRACE_SYSCALL_TABLE
48 #define TRACE_SYSCALL_TABLE(_template, _name, _nr, _nrargs) \
50 .func = __event_probe__##_template, \
51 .nrargs = (_nrargs), \
52 .fields = __event_fields___##_template, \
53 .desc = &__event_desc___##_name, \
56 #define CREATE_SYSCALL_TABLE
58 /* Create compatibility syscall table */
59 const struct trace_syscall_entry compat_sc_table
[] = {
60 #include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
61 #include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
63 const size_t compat_sc_table_len
= ARRAY_SIZE(compat_sc_table
);
65 #undef CREATE_SYSCALL_TABLE