projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng-tracepoint module notifier should return NOTIFY_OK
[lttng-modules.git]
/
lttng-syscalls.c
diff --git
a/lttng-syscalls.c
b/lttng-syscalls.c
index a3149d0d01caa4260bc2e0442907207f4f4aac4b..c9dc2753d0e1301a85eee3a3ed370c6b1ee5c814 100644
(file)
--- a/
lttng-syscalls.c
+++ b/
lttng-syscalls.c
@@
-38,6
+38,7
@@
#include <wrapper/tracepoint.h>
#include <wrapper/file.h>
#include <wrapper/rcu.h>
#include <wrapper/tracepoint.h>
#include <wrapper/file.h>
#include <wrapper/rcu.h>
+#include <wrapper/syscall.h>
#include <lttng-events.h>
#ifndef CONFIG_COMPAT
#include <lttng-events.h>
#ifndef CONFIG_COMPAT
@@
-132,6
+133,9
@@
struct user_msghdr;
LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(syscall_entry_##_name, PARAMS(_fields))
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_entry_##_template, syscall_entry_##_name)
LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(syscall_entry_##_name, PARAMS(_fields))
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_entry_##_template, syscall_entry_##_name)
+/* Enumerations only defined at first inclusion. */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values) \
+ LTTNG_TRACEPOINT_ENUM(_name, PARAMS(_values))
#undef TRACE_SYSTEM
#define TRACE_SYSTEM syscall_entry_integers
#define TRACE_INCLUDE_FILE syscalls_integers
#undef TRACE_SYSTEM
#define TRACE_SYSTEM syscall_entry_integers
#define TRACE_INCLUDE_FILE syscalls_integers
@@
-143,6
+147,7
@@
struct user_msghdr;
#include <instrumentation/syscalls/headers/syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
#include <instrumentation/syscalls/headers/syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@
-153,6
+158,7
@@
struct user_msghdr;
/* Hijack probe callback for compat system call enter */
#define TP_PROBE_CB(_template) &syscall_entry_probe
/* Hijack probe callback for compat system call enter */
#define TP_PROBE_CB(_template) &syscall_entry_probe
+#define LTTNG_SC_COMPAT
#define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
LTTNG_TRACEPOINT_EVENT(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_fields))
#define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
LTTNG_TRACEPOINT_EVENT(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_fields))
@@
-164,6
+170,8
@@
struct user_msghdr;
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_entry_##_template, \
compat_syscall_entry_##_name)
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_entry_##_template, \
compat_syscall_entry_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
#define TRACE_SYSTEM compat_syscall_entry_integers
#define TRACE_INCLUDE_FILE compat_syscalls_integers
#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
#define TRACE_SYSTEM compat_syscall_entry_integers
#define TRACE_INCLUDE_FILE compat_syscalls_integers
#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
@@
-174,6
+182,7
@@
struct user_msghdr;
#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@
-181,6
+190,7
@@
struct user_msghdr;
#undef TP_PROBE_CB
#undef _TRACE_SYSCALLS_INTEGERS_H
#undef _TRACE_SYSCALLS_POINTERS_H
#undef TP_PROBE_CB
#undef _TRACE_SYSCALLS_INTEGERS_H
#undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
#undef SC_ENTER
#undef SC_ENTER
@@
-208,6
+218,8
@@
struct user_msghdr;
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_exit_##_template, \
syscall_exit_##_name)
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_exit_##_template, \
syscall_exit_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
#define TRACE_SYSTEM syscall_exit_integers
#define TRACE_INCLUDE_FILE syscalls_integers
#include <instrumentation/syscalls/headers/syscalls_integers.h>
#define TRACE_SYSTEM syscall_exit_integers
#define TRACE_INCLUDE_FILE syscalls_integers
#include <instrumentation/syscalls/headers/syscalls_integers.h>
@@
-218,6
+230,7
@@
struct user_msghdr;
#include <instrumentation/syscalls/headers/syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
#include <instrumentation/syscalls/headers/syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@
-229,6
+242,7
@@
struct user_msghdr;
/* Hijack probe callback for compat system call exit */
#define TP_PROBE_CB(_template) &syscall_exit_probe
/* Hijack probe callback for compat system call exit */
#define TP_PROBE_CB(_template) &syscall_exit_probe
+#define LTTNG_SC_COMPAT
#define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
LTTNG_TRACEPOINT_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_fields))
#define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
LTTNG_TRACEPOINT_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
PARAMS(_fields))
@@
-240,6
+254,8
@@
struct user_msghdr;
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_exit_##_template, \
compat_syscall_exit_##_name)
#define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name) \
LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_exit_##_template, \
compat_syscall_exit_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
#define TRACE_SYSTEM compat_syscall_exit_integers
#define TRACE_INCLUDE_FILE compat_syscalls_integers
#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
#define TRACE_SYSTEM compat_syscall_exit_integers
#define TRACE_INCLUDE_FILE compat_syscalls_integers
#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
@@
-250,6
+266,7
@@
struct user_msghdr;
#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
#undef TRACE_INCLUDE_FILE
#undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
#undef SC_LTTNG_TRACEPOINT_EVENT_CODE
#undef SC_LTTNG_TRACEPOINT_EVENT
#undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@
-257,6
+274,7
@@
struct user_msghdr;
#undef TP_PROBE_CB
#undef _TRACE_SYSCALLS_INTEGERS_H
#undef _TRACE_SYSCALLS_POINTERS_H
#undef TP_PROBE_CB
#undef _TRACE_SYSCALLS_INTEGERS_H
#undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
#undef SC_EXIT
#undef SC_EXIT
@@
-357,9
+375,9
@@
struct lttng_syscall_filter {
static void syscall_entry_unknown(struct lttng_event *event,
struct pt_regs *regs, unsigned int id)
{
static void syscall_entry_unknown(struct lttng_event *event,
struct pt_regs *regs, unsigned int id)
{
- unsigned long args[
UNKNOWN_SYSCALL_NR
ARGS];
+ unsigned long args[
LTTNG_SYSCALL_NR_
ARGS];
-
syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS
, args);
+
lttng_syscall_get_arguments(current, regs
, args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_entry_unknown(event, id, args);
else
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_entry_unknown(event, id, args);
else
@@
-428,9
+446,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
case 1:
{
void (*fptr)(void *__data, unsigned long arg0) = entry->func;
case 1:
{
void (*fptr)(void *__data, unsigned long arg0) = entry->func;
- unsigned long args[
1
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0]);
break;
}
fptr(event, args[0]);
break;
}
@@
-439,9
+457,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
void (*fptr)(void *__data,
unsigned long arg0,
unsigned long arg1) = entry->func;
void (*fptr)(void *__data,
unsigned long arg0,
unsigned long arg1) = entry->func;
- unsigned long args[
2
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0], args[1]);
break;
}
fptr(event, args[0], args[1]);
break;
}
@@
-451,9
+469,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
- unsigned long args[
3
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0], args[1], args[2]);
break;
}
fptr(event, args[0], args[1], args[2]);
break;
}
@@
-464,9
+482,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
- unsigned long args[
4
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0], args[1], args[2], args[3]);
break;
}
fptr(event, args[0], args[1], args[2], args[3]);
break;
}
@@
-478,9
+496,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
- unsigned long args[
5
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0], args[1], args[2], args[3], args[4]);
break;
}
fptr(event, args[0], args[1], args[2], args[3], args[4]);
break;
}
@@
-493,9
+511,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
- unsigned long args[
6
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
fptr(event, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
@@
-508,9
+526,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
static void syscall_exit_unknown(struct lttng_event *event,
struct pt_regs *regs, int id, long ret)
{
static void syscall_exit_unknown(struct lttng_event *event,
struct pt_regs *regs, int id, long ret)
{
- unsigned long args[
UNKNOWN_SYSCALL_NR
ARGS];
+ unsigned long args[
LTTNG_SYSCALL_NR_
ARGS];
-
syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS
, args);
+
lttng_syscall_get_arguments(current, regs
, args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_exit_unknown(event, id, ret,
args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_exit_unknown(event, id, ret,
args);
@@
-584,9
+602,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
void (*fptr)(void *__data,
long ret,
unsigned long arg0) = entry->func;
void (*fptr)(void *__data,
long ret,
unsigned long arg0) = entry->func;
- unsigned long args[
1
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0]);
break;
}
fptr(event, ret, args[0]);
break;
}
@@
-596,9
+614,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
long ret,
unsigned long arg0,
unsigned long arg1) = entry->func;
long ret,
unsigned long arg0,
unsigned long arg1) = entry->func;
- unsigned long args[
2
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0], args[1]);
break;
}
fptr(event, ret, args[0], args[1]);
break;
}
@@
-609,9
+627,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
- unsigned long args[
3
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0], args[1], args[2]);
break;
}
fptr(event, ret, args[0], args[1], args[2]);
break;
}
@@
-623,9
+641,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
- unsigned long args[
4
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0], args[1], args[2], args[3]);
break;
}
fptr(event, ret, args[0], args[1], args[2], args[3]);
break;
}
@@
-638,9
+656,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
- unsigned long args[
5
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
break;
}
fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
break;
}
@@
-654,9
+672,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
- unsigned long args[
6
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
-
syscall_get_arguments(current, regs, 0, entry->nrar
gs, args);
+
lttng_syscall_get_arguments(current, re
gs, args);
fptr(event, ret, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
fptr(event, ret, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
@@
-1242,7
+1260,7
@@
long lttng_channel_syscall_mask(struct lttng_channel *channel,
filter = channel->sc_filter;
for (bit = 0; bit < ARRAY_SIZE(sc_table); bit++) {
filter = channel->sc_filter;
for (bit = 0; bit < ARRAY_SIZE(sc_table); bit++) {
-
bool
state;
+
char
state;
if (channel->sc_table) {
if (filter)
if (channel->sc_table) {
if (filter)
@@
-1255,7
+1273,7
@@
long lttng_channel_syscall_mask(struct lttng_channel *channel,
bt_bitfield_write_be(tmp_mask, char, bit, 1, state);
}
for (; bit < sc_tables_len; bit++) {
bt_bitfield_write_be(tmp_mask, char, bit, 1, state);
}
for (; bit < sc_tables_len; bit++) {
-
bool
state;
+
char
state;
if (channel->compat_sc_table) {
if (filter)
if (channel->compat_sc_table) {
if (filter)
This page took
0.028721 seconds
and
4
git commands to generate.