From: Mathieu Desnoyers Date: Tue, 6 Apr 2021 18:37:43 +0000 (-0400) Subject: Add entryexit field to kretprobes ABI X-Git-Tag: v2.13.0-rc1~28 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=88a82b1744612c10d95ba86dec6f8919b325ec77;p=lttng-modules.git Add entryexit field to kretprobes ABI At this stage, only "entryexit = 0" is supported. No behavior change except for validating that ENTRY and EXIT are unsupported (-EINVAL). It is possible to extend struct lttng_kernel_kretprobe because it is always used within struct lttng_kernel_event which contains enough zero-initialized padding due to char padding[LTTNG_KERNEL_EVENT_PADDING2]. Signed-off-by: Mathieu Desnoyers Change-Id: I96d86eebff66da4af186ef51c2ff13e2ed84a510 --- diff --git a/include/lttng/abi.h b/include/lttng/abi.h index 0cdd6534..5745635e 100644 --- a/include/lttng/abi.h +++ b/include/lttng/abi.h @@ -56,11 +56,18 @@ struct lttng_kernel_channel { char padding[LTTNG_KERNEL_CHANNEL_PADDING]; } __attribute__((packed)); +enum lttng_kernel_kretprobe_entryexit { + LTTNG_KERNEL_KRETPROBE_ENTRYEXIT = 0, + LTTNG_KERNEL_KRETPROBE_ENTRY = 1, + LTTNG_KERNEL_KRETPROBE_EXIT = 2, +}; + struct lttng_kernel_kretprobe { uint64_t addr; uint64_t offset; char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; + uint8_t entryexit; /* enum lttng_kernel_kretprobe_entryexit */ } __attribute__((packed)); /* diff --git a/src/lttng-abi.c b/src/lttng-abi.c index c06aa79a..eb68bce8 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -1746,9 +1746,19 @@ int lttng_abi_validate_event_param(struct lttng_kernel_event *event_param) } break; + case LTTNG_KERNEL_KRETPROBE: + switch (event_param->u.kretprobe.entryexit) { + case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + break; + case LTTNG_KERNEL_SYSCALL_ENTRY: /* Fall-through */ + case LTTNG_KERNEL_SYSCALL_EXIT: /* Fall-through */ + default: + return -EINVAL; + } + break; + case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ case LTTNG_KERNEL_UPROBE: break;