Add entryexit field to kretprobes ABI
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Apr 2021 18:37:43 +0000 (14:37 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Apr 2021 20:11:15 +0000 (16:11 -0400)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I96d86eebff66da4af186ef51c2ff13e2ed84a510

include/lttng/abi.h
src/lttng-abi.c

index 0cdd6534805cb9e09f0cb9f60d001ee129b4fe24..5745635e8e9bf937d7aca26d7efb5997cd22d6f8 100644 (file)
@@ -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));
 
 /*
index c06aa79acfe213c152a968ca20d04d9954c05c13..eb68bce8d15328da889e4f1077c87f779aa4b37d 100644 (file)
@@ -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;
 
This page took 0.030958 seconds and 4 git commands to generate.