kernel: Add `struct lttng_kernel_syscall` to ABI
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 25 Nov 2020 17:06:38 +0000 (12:06 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Dec 2020 17:25:37 +0000 (12:25 -0500)
This struct is now used by the kernel tracer to allow to selectively
turn on and off syscalls event firing.

This way, the sessiond can decide to turn on only syscall entries,
exits, or both.

This will be used by the upcoming event notifier features to only
generate a notification on syscall entry.

This new struct doesn't change the layout of the `lttng_kernel_event`
structure.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I478de30b91b415f517e9d0ac0686f3130f79d86b

src/bin/lttng-sessiond/trace-kernel.c
src/common/lttng-kernel.h

index dfdc9fd14e96b9b2124034983dc0d1db4525633a..a8154a3cc32c98d3286394c9238f48a54d7ed546 100644 (file)
@@ -434,6 +434,9 @@ enum lttng_error_code trace_kernel_create_event(
                break;
        case LTTNG_EVENT_SYSCALL:
                attr->instrumentation = LTTNG_KERNEL_SYSCALL;
+               attr->u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_ALL;
+               attr->u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRYEXIT;
+               attr->u.syscall.match = LTTNG_KERNEL_SYSCALL_MATCH_NAME;
                break;
        case LTTNG_EVENT_ALL:
                attr->instrumentation = LTTNG_KERNEL_ALL;
index fc2a1e25944f26cd8273353d5dd6ce49dce92e9e..565f5392878d97be8b27f2a3f13cb571b9ad8a5a 100644 (file)
@@ -129,6 +129,31 @@ struct lttng_kernel_event_callsite {
        } u;
 } LTTNG_PACKED;
 
+enum lttng_kernel_syscall_entryexit {
+       LTTNG_KERNEL_SYSCALL_ENTRYEXIT  = 0,
+       LTTNG_KERNEL_SYSCALL_ENTRY      = 1,
+       LTTNG_KERNEL_SYSCALL_EXIT       = 2,
+};
+
+enum lttng_kernel_syscall_abi {
+       LTTNG_KERNEL_SYSCALL_ABI_ALL    = 0,
+       LTTNG_KERNEL_SYSCALL_ABI_NATIVE = 1,
+       LTTNG_KERNEL_SYSCALL_ABI_COMPAT = 2,
+};
+
+enum lttng_kernel_syscall_match {
+       LTTNG_KERNEL_SYSCALL_MATCH_NAME = 0,
+       LTTNG_KERNEL_SYSCALL_MATCH_NR   = 1,
+};
+
+struct lttng_kernel_syscall {
+       uint8_t entryexit;      /* enum lttng_kernel_syscall_entryexit */
+       uint8_t abi;            /* enum lttng_kernel_syscall_abi */
+       uint8_t match;          /* enum lttng_kernel_syscall_match */
+       uint8_t padding;
+       uint32_t nr;            /* For LTTNG_SYSCALL_MATCH_NR */
+} LTTNG_PACKED;
+
 /* Function tracer */
 struct lttng_kernel_function {
        char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
@@ -145,8 +170,9 @@ struct lttng_kernel_event {
        union {
                struct lttng_kernel_kretprobe kretprobe;
                struct lttng_kernel_kprobe kprobe;
-               struct lttng_kernel_uprobe uprobe;
                struct lttng_kernel_function ftrace;
+               struct lttng_kernel_uprobe uprobe;
+               struct lttng_kernel_syscall syscall;
                char padding[LTTNG_KERNEL_EVENT_PADDING2];
        } u;
 } LTTNG_PACKED;
This page took 0.028258 seconds and 4 git commands to generate.