Rename "tsc" to "timestamp"
[lttng-modules.git] / src / lttng-syscalls-entry-compat-table.c
CommitLineData
e42c4f49
FD
1/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2 *
3 * lttng-syscalls-entry-compat-table.c
4 *
5 * LTTng syscall entry compat probes.
6 *
7 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * Copyright (C) 2021 Francis Deslauriers <francis.deslauriers@efficios.com>
9 */
10
11#include <wrapper/tracepoint.h>
12
13#include "lttng-syscalls.h"
14
15
16#ifdef IA32_NR_syscalls
17#define NR_compat_syscalls IA32_NR_syscalls
18#else
19#define NR_compat_syscalls NR_syscalls
20#endif
21
22/*
23 * Create LTTng tracepoint probes.
24 */
25#define LTTNG_PACKAGE_BUILD
26#define CREATE_TRACE_POINTS
27#define TP_MODULE_NOINIT
b03cf820 28#define TRACE_INCLUDE_PATH instrumentation/syscalls
e42c4f49
FD
29
30#define PARAMS(args...) args
31
32#define SC_ENTER
33
34#undef sc_exit
35#define sc_exit(...)
36#undef sc_in
37#define sc_in(...) __VA_ARGS__
38#undef sc_out
39#define sc_out(...)
40#undef sc_inout
41#define sc_inout(...) __VA_ARGS__
42
43#define LTTNG_TRACEPOINT_TYPE_EXTERN
44
45#include <lttng/events-reset.h>
46
47/* Hijack probe callback for system call enter */
48#undef TP_PROBE_CB
49#define TP_PROBE_CB(_template) &syscall_entry_event_probe
50#define LTTNG_SC_COMPAT
51#define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
52 LTTNG_TRACEPOINT_EVENT(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
53 PARAMS(_fields))
54#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code_pre, _fields, _code_post) \
55 LTTNG_TRACEPOINT_EVENT_CODE(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
56 PARAMS(_locvar), PARAMS(_code_pre), \
57 PARAMS(_fields), PARAMS(_code_post))
58#define SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \
59 LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(compat_syscall_entry_##_name, PARAMS(_fields))
60#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
61 LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_entry_##_template, compat_syscall_entry_##_name)
62
63#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values) \
64 LTTNG_TRACEPOINT_ENUM(_name, PARAMS(_values))
65#undef TRACE_SYSTEM
66#define TRACE_SYSTEM compat_syscall_entry_integers
67#define TRACE_INCLUDE_FILE compat_syscalls_integers
b03cf820 68#include <instrumentation/syscalls/syscalls_integers.h>
e42c4f49
FD
69#undef TRACE_INCLUDE_FILE
70#undef TRACE_SYSTEM
71#define TRACE_SYSTEM compat_syscall_entry_pointers
72#define TRACE_INCLUDE_FILE compat_syscalls_pointers
b03cf820 73#include <instrumentation/syscalls/syscalls_pointers.h>
e42c4f49
FD
74#undef TRACE_INCLUDE_FILE
75#undef TRACE_SYSTEM
76#undef SC_LTTNG_TRACEPOINT_ENUM
77#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
78#undef SC_LTTNG_TRACEPOINT_EVENT
79#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
80#undef SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
81#undef TP_PROBE_CB
82
83#undef _TRACE_SYSCALLS_INTEGERS_H
84#undef _TRACE_SYSCALLS_POINTERS_H
85#undef LTTNG_SC_COMPAT
86
87#define CREATE_SYSCALL_TABLE
88
89#undef sc_exit
90#define sc_exit(...)
91
92#undef TRACE_SYSCALL_TABLE
93#define TRACE_SYSCALL_TABLE(_template, _name, _nr, _nrargs) \
94 [ _nr ] = { \
95 .event_func = __event_probe__compat_syscall_entry_##_template, \
96 .nrargs = (_nrargs), \
97 .fields = __event_fields___compat_syscall_entry_##_template, \
98 .desc = &__event_desc___compat_syscall_entry_##_name, \
99 },
100
101/* Event compat syscall enter table */
102const struct trace_syscall_entry _compat_sc_table[] = {
b03cf820
MJ
103#include <instrumentation/syscalls/compat_syscalls_integers.h>
104#include <instrumentation/syscalls/compat_syscalls_pointers.h>
e42c4f49
FD
105};
106
107const struct trace_syscall_table compat_sc_table = {
108 .table = _compat_sc_table,
109 .len = ARRAY_SIZE(_compat_sc_table),
110};
111
112#undef SC_ENTER
113
114#undef CREATE_SYSCALL_TABLE
This page took 0.036146 seconds and 4 git commands to generate.