From 606828e401c405619a0c7249e8c7e3291cc1cb45 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 14 Apr 2021 13:52:07 -0400 Subject: [PATCH] Namespace LTTng modules ABI with lttng_kernel_abi_ prefix Standardize on lttng_kernel_abi_ prefix for the lttng modules ABI to eliminate namespace clash between lttng-modules core code and its ABI. Signed-off-by: Mathieu Desnoyers Change-Id: I3b1c8d6f46702e57defa17d683ede576466ba3ce --- include/lttng/abi-old.h | 104 ++-- include/lttng/abi.h | 512 +++++++++---------- include/lttng/events.h | 56 +- include/ringbuffer/vfs.h | 92 ++-- src/lib/ringbuffer/ring_buffer_vfs.c | 76 +-- src/lttng-abi.c | 650 ++++++++++++------------ src/lttng-bytecode.c | 4 +- src/lttng-calibrate.c | 4 +- src/lttng-context-callstack.c | 4 +- src/lttng-event-notifier-notification.c | 2 +- src/lttng-events.c | 337 ++++++------ src/lttng-probes.c | 2 +- src/lttng-syscalls.c | 132 ++--- src/probes/lttng-kprobes.c | 4 +- src/probes/lttng-kretprobes.c | 2 +- src/probes/lttng-uprobes.c | 6 +- 16 files changed, 987 insertions(+), 1000 deletions(-) diff --git a/include/lttng/abi-old.h b/include/lttng/abi-old.h index ac8d938e..23eeacf0 100644 --- a/include/lttng/abi-old.h +++ b/include/lttng/abi-old.h @@ -16,113 +16,113 @@ /* * LTTng DebugFS ABI structures. */ -#define LTTNG_KERNEL_OLD_CHANNEL_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_old_channel { +#define LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_old_channel { int overwrite; /* 1: overwrite, 0: discard */ uint64_t subbuf_size; /* in bytes */ uint64_t num_subbuf; unsigned int switch_timer_interval; /* usecs */ unsigned int read_timer_interval; /* usecs */ - enum lttng_kernel_output output; /* splice, mmap */ - char padding[LTTNG_KERNEL_OLD_CHANNEL_PADDING]; + enum lttng_kernel_abi_output output; /* splice, mmap */ + char padding[LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING]; }; -struct lttng_kernel_old_kretprobe { +struct lttng_kernel_abi_old_kretprobe { uint64_t addr; uint64_t offset; - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; }; /* * Either addr is used, or symbol_name and offset. */ -struct lttng_kernel_old_kprobe { +struct lttng_kernel_abi_old_kprobe { uint64_t addr; uint64_t offset; - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; }; -struct lttng_kernel_old_function_tracer { - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; +struct lttng_kernel_abi_old_function_tracer { + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; }; /* * For syscall tracing, name = '\0' means "enable all". */ -#define LTTNG_KERNEL_OLD_EVENT_PADDING1 16 -#define LTTNG_KERNEL_OLD_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_old_event { - char name[LTTNG_KERNEL_SYM_NAME_LEN]; /* event name */ - enum lttng_kernel_instrumentation instrumentation; - char padding[LTTNG_KERNEL_OLD_EVENT_PADDING1]; +#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING1 16 +#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_old_event { + char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; /* event name */ + enum lttng_kernel_abi_instrumentation instrumentation; + char padding[LTTNG_KERNEL_ABI_OLD_EVENT_PADDING1]; /* Per instrumentation type configuration */ union { - struct lttng_kernel_old_kretprobe kretprobe; - struct lttng_kernel_old_kprobe kprobe; - struct lttng_kernel_old_function_tracer ftrace; - char padding[LTTNG_KERNEL_OLD_EVENT_PADDING2]; + struct lttng_kernel_abi_old_kretprobe kretprobe; + struct lttng_kernel_abi_old_kprobe kprobe; + struct lttng_kernel_abi_old_function_tracer ftrace; + char padding[LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2]; } u; }; -struct lttng_kernel_old_tracer_version { +struct lttng_kernel_abi_old_tracer_version { uint32_t major; uint32_t minor; uint32_t patchlevel; }; -struct lttng_kernel_old_calibrate { - enum lttng_kernel_calibrate_type type; /* type (input) */ +struct lttng_kernel_abi_old_calibrate { + enum lttng_kernel_abi_calibrate_type type; /* type (input) */ }; -struct lttng_kernel_old_perf_counter_ctx { +struct lttng_kernel_abi_old_perf_counter_ctx { uint32_t type; uint64_t config; - char name[LTTNG_KERNEL_SYM_NAME_LEN]; + char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; }; -#define LTTNG_KERNEL_OLD_CONTEXT_PADDING1 16 -#define LTTNG_KERNEL_OLD_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_old_context { - enum lttng_kernel_context_type ctx; - char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING1]; +#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1 16 +#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_old_context { + enum lttng_kernel_abi_context_type ctx; + char padding[LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1]; union { - struct lttng_kernel_old_perf_counter_ctx perf_counter; - char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING2]; + struct lttng_kernel_abi_old_perf_counter_ctx perf_counter; + char padding[LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2]; } u; }; /* LTTng file descriptor ioctl */ -#define LTTNG_KERNEL_OLD_SESSION _IO(0xF6, 0x40) -#define LTTNG_KERNEL_OLD_TRACER_VERSION \ - _IOR(0xF6, 0x41, struct lttng_kernel_old_tracer_version) -#define LTTNG_KERNEL_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42) -#define LTTNG_KERNEL_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43) -#define LTTNG_KERNEL_OLD_CALIBRATE \ - _IOWR(0xF6, 0x44, struct lttng_kernel_old_calibrate) +#define LTTNG_KERNEL_ABI_OLD_SESSION _IO(0xF6, 0x40) +#define LTTNG_KERNEL_ABI_OLD_TRACER_VERSION \ + _IOR(0xF6, 0x41, struct lttng_kernel_abi_old_tracer_version) +#define LTTNG_KERNEL_ABI_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42) +#define LTTNG_KERNEL_ABI_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43) +#define LTTNG_KERNEL_ABI_OLD_CALIBRATE \ + _IOWR(0xF6, 0x44, struct lttng_kernel_abi_old_calibrate) /* Session FD ioctl */ -#define LTTNG_KERNEL_OLD_METADATA \ - _IOW(0xF6, 0x50, struct lttng_kernel_old_channel) -#define LTTNG_KERNEL_OLD_CHANNEL \ - _IOW(0xF6, 0x51, struct lttng_kernel_old_channel) -#define LTTNG_KERNEL_OLD_SESSION_START _IO(0xF6, 0x52) -#define LTTNG_KERNEL_OLD_SESSION_STOP _IO(0xF6, 0x53) +#define LTTNG_KERNEL_ABI_OLD_METADATA \ + _IOW(0xF6, 0x50, struct lttng_kernel_abi_old_channel) +#define LTTNG_KERNEL_ABI_OLD_CHANNEL \ + _IOW(0xF6, 0x51, struct lttng_kernel_abi_old_channel) +#define LTTNG_KERNEL_ABI_OLD_SESSION_START _IO(0xF6, 0x52) +#define LTTNG_KERNEL_ABI_OLD_SESSION_STOP _IO(0xF6, 0x53) /* Channel FD ioctl */ -#define LTTNG_KERNEL_OLD_STREAM _IO(0xF6, 0x60) -#define LTTNG_KERNEL_OLD_EVENT \ - _IOW(0xF6, 0x61, struct lttng_kernel_old_event) +#define LTTNG_KERNEL_ABI_OLD_STREAM _IO(0xF6, 0x60) +#define LTTNG_KERNEL_ABI_OLD_EVENT \ + _IOW(0xF6, 0x61, struct lttng_kernel_abi_old_event) /* Event and Channel FD ioctl */ -#define LTTNG_KERNEL_OLD_CONTEXT \ - _IOW(0xF6, 0x70, struct lttng_kernel_old_context) +#define LTTNG_KERNEL_ABI_OLD_CONTEXT \ + _IOW(0xF6, 0x70, struct lttng_kernel_abi_old_context) /* Event, Channel and Session ioctl */ -#define LTTNG_KERNEL_OLD_ENABLE _IO(0xF6, 0x80) -#define LTTNG_KERNEL_OLD_DISABLE _IO(0xF6, 0x81) +#define LTTNG_KERNEL_ABI_OLD_ENABLE _IO(0xF6, 0x80) +#define LTTNG_KERNEL_ABI_OLD_DISABLE _IO(0xF6, 0x81) #endif /* _LTTNG_ABI_OLD_H */ diff --git a/include/lttng/abi.h b/include/lttng/abi.h index 5745635e..5a5ad753 100644 --- a/include/lttng/abi.h +++ b/include/lttng/abi.h @@ -17,108 +17,108 @@ * Major/minor version of ABI exposed to lttng tools. Major number * should be increased when an incompatible ABI change is done. */ -#define LTTNG_MODULES_ABI_MAJOR_VERSION 2 -#define LTTNG_MODULES_ABI_MINOR_VERSION 6 - -#define LTTNG_KERNEL_SYM_NAME_LEN 256 -#define LTTNG_KERNEL_SESSION_NAME_LEN 256 -#define LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN 26 - -enum lttng_kernel_instrumentation { - LTTNG_KERNEL_TRACEPOINT = 0, - LTTNG_KERNEL_KPROBE = 1, - LTTNG_KERNEL_FUNCTION = 2, - LTTNG_KERNEL_KRETPROBE = 3, - LTTNG_KERNEL_NOOP = 4, /* not hooked */ - LTTNG_KERNEL_SYSCALL = 5, - LTTNG_KERNEL_UPROBE = 6, +#define LTTNG_KERNEL_ABI_MAJOR_VERSION 2 +#define LTTNG_KERNEL_ABI_MINOR_VERSION 6 + +#define LTTNG_KERNEL_ABI_SYM_NAME_LEN 256 +#define LTTNG_KERNEL_ABI_SESSION_NAME_LEN 256 +#define LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN 26 + +enum lttng_kernel_abi_instrumentation { + LTTNG_KERNEL_ABI_TRACEPOINT = 0, + LTTNG_KERNEL_ABI_KPROBE = 1, + LTTNG_KERNEL_ABI_FUNCTION = 2, + LTTNG_KERNEL_ABI_KRETPROBE = 3, + LTTNG_KERNEL_ABI_NOOP = 4, /* not hooked */ + LTTNG_KERNEL_ABI_SYSCALL = 5, + LTTNG_KERNEL_ABI_UPROBE = 6, }; /* * LTTng consumer mode */ -enum lttng_kernel_output { - LTTNG_KERNEL_SPLICE = 0, - LTTNG_KERNEL_MMAP = 1, +enum lttng_kernel_abi_output { + LTTNG_KERNEL_ABI_SPLICE = 0, + LTTNG_KERNEL_ABI_MMAP = 1, }; /* * LTTng DebugFS ABI structures. */ -#define LTTNG_KERNEL_CHANNEL_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_channel { +#define LTTNG_KERNEL_ABI_CHANNEL_PADDING LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_channel { uint64_t subbuf_size; /* in bytes */ uint64_t num_subbuf; unsigned int switch_timer_interval; /* usecs */ unsigned int read_timer_interval; /* usecs */ - uint32_t output; /* enum lttng_kernel_output (splice, mmap) */ + uint32_t output; /* enum lttng_kernel_abi_output (splice, mmap) */ int overwrite; /* 1: overwrite, 0: discard */ - char padding[LTTNG_KERNEL_CHANNEL_PADDING]; + char padding[LTTNG_KERNEL_ABI_CHANNEL_PADDING]; } __attribute__((packed)); -enum lttng_kernel_kretprobe_entryexit { - LTTNG_KERNEL_KRETPROBE_ENTRYEXIT = 0, - LTTNG_KERNEL_KRETPROBE_ENTRY = 1, - LTTNG_KERNEL_KRETPROBE_EXIT = 2, +enum lttng_kernel_abi_kretprobe_entryexit { + LTTNG_KERNEL_ABI_KRETPROBE_ENTRYEXIT = 0, + LTTNG_KERNEL_ABI_KRETPROBE_ENTRY = 1, + LTTNG_KERNEL_ABI_KRETPROBE_EXIT = 2, }; -struct lttng_kernel_kretprobe { +struct lttng_kernel_abi_kretprobe { uint64_t addr; uint64_t offset; - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; - uint8_t entryexit; /* enum lttng_kernel_kretprobe_entryexit */ + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; + uint8_t entryexit; /* enum lttng_kernel_abi_kretprobe_entryexit */ } __attribute__((packed)); /* * Either addr is used, or symbol_name and offset. */ -struct lttng_kernel_kprobe { +struct lttng_kernel_abi_kprobe { uint64_t addr; uint64_t offset; - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; } __attribute__((packed)); -struct lttng_kernel_function_tracer { - char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; +struct lttng_kernel_abi_function_tracer { + char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; } __attribute__((packed)); -struct lttng_kernel_uprobe { +struct lttng_kernel_abi_uprobe { int fd; } __attribute__((packed)); -struct lttng_kernel_event_callsite_uprobe { +struct lttng_kernel_abi_event_callsite_uprobe { uint64_t offset; } __attribute__((packed)); -struct lttng_kernel_event_callsite { +struct lttng_kernel_abi_event_callsite { union { - struct lttng_kernel_event_callsite_uprobe uprobe; + struct lttng_kernel_abi_event_callsite_uprobe uprobe; } u; } __attribute__((packed)); -enum lttng_kernel_syscall_entryexit { - LTTNG_KERNEL_SYSCALL_ENTRYEXIT = 0, - LTTNG_KERNEL_SYSCALL_ENTRY = 1, - LTTNG_KERNEL_SYSCALL_EXIT = 2, +enum lttng_kernel_abi_syscall_entryexit { + LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT = 0, + LTTNG_KERNEL_ABI_SYSCALL_ENTRY = 1, + LTTNG_KERNEL_ABI_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_abi_syscall_abi { + LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL = 0, + LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE = 1, + LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT = 2, }; -enum lttng_kernel_syscall_match { - LTTNG_KERNEL_SYSCALL_MATCH_NAME = 0, - LTTNG_KERNEL_SYSCALL_MATCH_NR = 1, /* Not implemented. */ +enum lttng_kernel_abi_syscall_match { + LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME = 0, + LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR = 1, /* Not implemented. */ }; -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 */ +struct lttng_kernel_abi_syscall { + uint8_t entryexit; /* enum lttng_kernel_abi_syscall_entryexit */ + uint8_t abi; /* enum lttng_kernel_abi_syscall_abi */ + uint8_t match; /* enum lttng_kernel_abi_syscall_match */ uint8_t padding; uint32_t nr; /* For LTTNG_SYSCALL_MATCH_NR */ } __attribute__((packed)); @@ -126,45 +126,45 @@ struct lttng_kernel_syscall { /* * For syscall tracing, name = "*" means "enable all". */ -#define LTTNG_KERNEL_EVENT_PADDING1 8 -#define LTTNG_KERNEL_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_event { - char name[LTTNG_KERNEL_SYM_NAME_LEN]; /* event name */ - uint32_t instrumentation; /* enum lttng_kernel_instrumentation */ +#define LTTNG_KERNEL_ABI_EVENT_PADDING1 8 +#define LTTNG_KERNEL_ABI_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_event { + char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; /* event name */ + uint32_t instrumentation; /* enum lttng_kernel_abi_instrumentation */ uint64_t token; /* User-provided token */ - char padding[LTTNG_KERNEL_EVENT_PADDING1]; + char padding[LTTNG_KERNEL_ABI_EVENT_PADDING1]; /* Per instrumentation type configuration */ union { - struct lttng_kernel_kretprobe kretprobe; - struct lttng_kernel_kprobe kprobe; - struct lttng_kernel_function_tracer ftrace; - struct lttng_kernel_uprobe uprobe; - struct lttng_kernel_syscall syscall; - char padding[LTTNG_KERNEL_EVENT_PADDING2]; + struct lttng_kernel_abi_kretprobe kretprobe; + struct lttng_kernel_abi_kprobe kprobe; + struct lttng_kernel_abi_function_tracer ftrace; + struct lttng_kernel_abi_uprobe uprobe; + struct lttng_kernel_abi_syscall syscall; + char padding[LTTNG_KERNEL_ABI_EVENT_PADDING2]; } u; } __attribute__((packed)); -#define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING 32 -struct lttng_kernel_event_notifier { - struct lttng_kernel_event event; +#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING 32 +struct lttng_kernel_abi_event_notifier { + struct lttng_kernel_abi_event event; uint64_t error_counter_index; - char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING]; + char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING]; } __attribute__((packed)); -#define LTTNG_KERNEL_COUNTER_DIMENSION_MAX 4 +#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX 4 -enum lttng_kernel_counter_arithmetic { - LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR = 0, +enum lttng_kernel_abi_counter_arithmetic { + LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0, }; -enum lttng_kernel_counter_bitness { - LTTNG_KERNEL_COUNTER_BITNESS_32 = 0, - LTTNG_KERNEL_COUNTER_BITNESS_64 = 1, +enum lttng_kernel_abi_counter_bitness { + LTTNG_KERNEL_ABI_COUNTER_BITNESS_32 = 0, + LTTNG_KERNEL_ABI_COUNTER_BITNESS_64 = 1, }; -struct lttng_kernel_counter_dimension { +struct lttng_kernel_abi_counter_dimension { uint64_t size; uint64_t underflow_index; uint64_t overflow_index; @@ -172,204 +172,204 @@ struct lttng_kernel_counter_dimension { uint8_t has_overflow; } __attribute__((packed)); -#define LTTNG_KERNEL_COUNTER_CONF_PADDING1 67 -struct lttng_kernel_counter_conf { - uint32_t arithmetic; /* enum lttng_kernel_counter_arithmetic */ - uint32_t bitness; /* enum lttng_kernel_counter_bitness */ +#define LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1 67 +struct lttng_kernel_abi_counter_conf { + uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */ + uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */ uint32_t number_dimensions; int64_t global_sum_step; - struct lttng_kernel_counter_dimension dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; + struct lttng_kernel_abi_counter_dimension dimensions[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX]; uint8_t coalesce_hits; - char padding[LTTNG_KERNEL_COUNTER_CONF_PADDING1]; + char padding[LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1]; } __attribute__((packed)); -struct lttng_kernel_counter_index { +struct lttng_kernel_abi_counter_index { uint32_t number_dimensions; - uint64_t dimension_indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; + uint64_t dimension_indexes[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX]; } __attribute__((packed)); -struct lttng_kernel_counter_value { +struct lttng_kernel_abi_counter_value { int64_t value; uint8_t underflow; uint8_t overflow; } __attribute__((packed)); -#define LTTNG_KERNEL_COUNTER_READ_PADDING 32 -struct lttng_kernel_counter_read { - struct lttng_kernel_counter_index index; +#define LTTNG_KERNEL_ABI_COUNTER_READ_PADDING 32 +struct lttng_kernel_abi_counter_read { + struct lttng_kernel_abi_counter_index index; int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */ - struct lttng_kernel_counter_value value; /* output */ - char padding[LTTNG_KERNEL_COUNTER_READ_PADDING]; + struct lttng_kernel_abi_counter_value value; /* output */ + char padding[LTTNG_KERNEL_ABI_COUNTER_READ_PADDING]; } __attribute__((packed)); -#define LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING 32 -struct lttng_kernel_counter_aggregate { - struct lttng_kernel_counter_index index; - struct lttng_kernel_counter_value value; /* output */ - char padding[LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING]; +#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING 32 +struct lttng_kernel_abi_counter_aggregate { + struct lttng_kernel_abi_counter_index index; + struct lttng_kernel_abi_counter_value value; /* output */ + char padding[LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING]; } __attribute__((packed)); -#define LTTNG_KERNEL_COUNTER_CLEAR_PADDING 32 -struct lttng_kernel_counter_clear { - struct lttng_kernel_counter_index index; - char padding[LTTNG_KERNEL_COUNTER_CLEAR_PADDING]; +#define LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING 32 +struct lttng_kernel_abi_counter_clear { + struct lttng_kernel_abi_counter_index index; + char padding[LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING]; } __attribute__((packed)); -#define LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 -struct lttng_kernel_event_notifier_notification { +#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 +struct lttng_kernel_abi_event_notifier_notification { uint64_t token; uint16_t capture_buf_size; - char padding[LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING]; + char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING]; } __attribute__((packed)); -struct lttng_kernel_tracer_version { +struct lttng_kernel_abi_tracer_version { uint32_t major; uint32_t minor; uint32_t patchlevel; } __attribute__((packed)); -struct lttng_kernel_tracer_abi_version { +struct lttng_kernel_abi_tracer_abi_version { uint32_t major; uint32_t minor; } __attribute__((packed)); -struct lttng_kernel_session_name { - char name[LTTNG_KERNEL_SESSION_NAME_LEN]; +struct lttng_kernel_abi_session_name { + char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN]; } __attribute__((packed)); -struct lttng_kernel_session_creation_time { - char iso8601[LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN]; +struct lttng_kernel_abi_session_creation_time { + char iso8601[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN]; } __attribute__((packed)); -enum lttng_kernel_calibrate_type { - LTTNG_KERNEL_CALIBRATE_KRETPROBE, +enum lttng_kernel_abi_calibrate_type { + LTTNG_KERNEL_ABI_CALIBRATE_KRETPROBE, }; -struct lttng_kernel_calibrate { - uint32_t type; /* enum lttng_kernel_calibrate_type (input) */ +struct lttng_kernel_abi_calibrate { + uint32_t type; /* enum lttng_kernel_abi_calibrate_type (input) */ } __attribute__((packed)); -struct lttng_kernel_syscall_mask { +struct lttng_kernel_abi_syscall_mask { uint32_t len; /* in bits */ char mask[]; } __attribute__((packed)); -enum lttng_kernel_context_type { - LTTNG_KERNEL_CONTEXT_PID = 0, - LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1, - LTTNG_KERNEL_CONTEXT_PROCNAME = 2, - LTTNG_KERNEL_CONTEXT_PRIO = 3, - LTTNG_KERNEL_CONTEXT_NICE = 4, - LTTNG_KERNEL_CONTEXT_VPID = 5, - LTTNG_KERNEL_CONTEXT_TID = 6, - LTTNG_KERNEL_CONTEXT_VTID = 7, - LTTNG_KERNEL_CONTEXT_PPID = 8, - LTTNG_KERNEL_CONTEXT_VPPID = 9, - LTTNG_KERNEL_CONTEXT_HOSTNAME = 10, - LTTNG_KERNEL_CONTEXT_CPU_ID = 11, - LTTNG_KERNEL_CONTEXT_INTERRUPTIBLE = 12, - LTTNG_KERNEL_CONTEXT_PREEMPTIBLE = 13, - LTTNG_KERNEL_CONTEXT_NEED_RESCHEDULE = 14, - LTTNG_KERNEL_CONTEXT_MIGRATABLE = 15, - LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL = 16, - LTTNG_KERNEL_CONTEXT_CALLSTACK_USER = 17, - LTTNG_KERNEL_CONTEXT_CGROUP_NS = 18, - LTTNG_KERNEL_CONTEXT_IPC_NS = 19, - LTTNG_KERNEL_CONTEXT_MNT_NS = 20, - LTTNG_KERNEL_CONTEXT_NET_NS = 21, - LTTNG_KERNEL_CONTEXT_PID_NS = 22, - LTTNG_KERNEL_CONTEXT_USER_NS = 23, - LTTNG_KERNEL_CONTEXT_UTS_NS = 24, - LTTNG_KERNEL_CONTEXT_UID = 25, - LTTNG_KERNEL_CONTEXT_EUID = 26, - LTTNG_KERNEL_CONTEXT_SUID = 27, - LTTNG_KERNEL_CONTEXT_GID = 28, - LTTNG_KERNEL_CONTEXT_EGID = 29, - LTTNG_KERNEL_CONTEXT_SGID = 30, - LTTNG_KERNEL_CONTEXT_VUID = 31, - LTTNG_KERNEL_CONTEXT_VEUID = 32, - LTTNG_KERNEL_CONTEXT_VSUID = 33, - LTTNG_KERNEL_CONTEXT_VGID = 34, - LTTNG_KERNEL_CONTEXT_VEGID = 35, - LTTNG_KERNEL_CONTEXT_VSGID = 36, - LTTNG_KERNEL_CONTEXT_TIME_NS = 37, +enum lttng_kernel_abi_context_type { + LTTNG_KERNEL_ABI_CONTEXT_PID = 0, + LTTNG_KERNEL_ABI_CONTEXT_PERF_COUNTER = 1, + LTTNG_KERNEL_ABI_CONTEXT_PROCNAME = 2, + LTTNG_KERNEL_ABI_CONTEXT_PRIO = 3, + LTTNG_KERNEL_ABI_CONTEXT_NICE = 4, + LTTNG_KERNEL_ABI_CONTEXT_VPID = 5, + LTTNG_KERNEL_ABI_CONTEXT_TID = 6, + LTTNG_KERNEL_ABI_CONTEXT_VTID = 7, + LTTNG_KERNEL_ABI_CONTEXT_PPID = 8, + LTTNG_KERNEL_ABI_CONTEXT_VPPID = 9, + LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME = 10, + LTTNG_KERNEL_ABI_CONTEXT_CPU_ID = 11, + LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE = 12, + LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE = 13, + LTTNG_KERNEL_ABI_CONTEXT_NEED_RESCHEDULE = 14, + LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE = 15, + LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL = 16, + LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER = 17, + LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS = 18, + LTTNG_KERNEL_ABI_CONTEXT_IPC_NS = 19, + LTTNG_KERNEL_ABI_CONTEXT_MNT_NS = 20, + LTTNG_KERNEL_ABI_CONTEXT_NET_NS = 21, + LTTNG_KERNEL_ABI_CONTEXT_PID_NS = 22, + LTTNG_KERNEL_ABI_CONTEXT_USER_NS = 23, + LTTNG_KERNEL_ABI_CONTEXT_UTS_NS = 24, + LTTNG_KERNEL_ABI_CONTEXT_UID = 25, + LTTNG_KERNEL_ABI_CONTEXT_EUID = 26, + LTTNG_KERNEL_ABI_CONTEXT_SUID = 27, + LTTNG_KERNEL_ABI_CONTEXT_GID = 28, + LTTNG_KERNEL_ABI_CONTEXT_EGID = 29, + LTTNG_KERNEL_ABI_CONTEXT_SGID = 30, + LTTNG_KERNEL_ABI_CONTEXT_VUID = 31, + LTTNG_KERNEL_ABI_CONTEXT_VEUID = 32, + LTTNG_KERNEL_ABI_CONTEXT_VSUID = 33, + LTTNG_KERNEL_ABI_CONTEXT_VGID = 34, + LTTNG_KERNEL_ABI_CONTEXT_VEGID = 35, + LTTNG_KERNEL_ABI_CONTEXT_VSGID = 36, + LTTNG_KERNEL_ABI_CONTEXT_TIME_NS = 37, }; -struct lttng_kernel_perf_counter_ctx { +struct lttng_kernel_abi_perf_counter_ctx { uint32_t type; uint64_t config; - char name[LTTNG_KERNEL_SYM_NAME_LEN]; + char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; } __attribute__((packed)); -#define LTTNG_KERNEL_CONTEXT_PADDING1 16 -#define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 -struct lttng_kernel_context { - uint32_t ctx; /*enum lttng_kernel_context_type */ - char padding[LTTNG_KERNEL_CONTEXT_PADDING1]; +#define LTTNG_KERNEL_ABI_CONTEXT_PADDING1 16 +#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32 +struct lttng_kernel_abi_context { + uint32_t ctx; /*enum lttng_kernel_abi_context_type */ + char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING1]; union { - struct lttng_kernel_perf_counter_ctx perf_counter; - char padding[LTTNG_KERNEL_CONTEXT_PADDING2]; + struct lttng_kernel_abi_perf_counter_ctx perf_counter; + char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING2]; } u; } __attribute__((packed)); -#define LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN 65536 -struct lttng_kernel_filter_bytecode { +#define LTTNG_KERNEL_ABI_FILTER_BYTECODE_MAX_LEN 65536 +struct lttng_kernel_abi_filter_bytecode { uint32_t len; uint32_t reloc_offset; uint64_t seqnum; char data[0]; } __attribute__((packed)); -#define LTTNG_KERNEL_CAPTURE_BYTECODE_MAX_LEN 65536 -struct lttng_kernel_capture_bytecode { +#define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN 65536 +struct lttng_kernel_abi_capture_bytecode { uint32_t len; uint32_t reloc_offset; uint64_t seqnum; char data[0]; } __attribute__((packed)); -enum lttng_kernel_tracker_type { - LTTNG_KERNEL_TRACKER_UNKNOWN = -1, +enum lttng_kernel_abi_tracker_type { + LTTNG_KERNEL_ABI_TRACKER_UNKNOWN = -1, - LTTNG_KERNEL_TRACKER_PID = 0, - LTTNG_KERNEL_TRACKER_VPID = 1, - LTTNG_KERNEL_TRACKER_UID = 2, - LTTNG_KERNEL_TRACKER_VUID = 3, - LTTNG_KERNEL_TRACKER_GID = 4, - LTTNG_KERNEL_TRACKER_VGID = 5, + LTTNG_KERNEL_ABI_TRACKER_PID = 0, + LTTNG_KERNEL_ABI_TRACKER_VPID = 1, + LTTNG_KERNEL_ABI_TRACKER_UID = 2, + LTTNG_KERNEL_ABI_TRACKER_VUID = 3, + LTTNG_KERNEL_ABI_TRACKER_GID = 4, + LTTNG_KERNEL_ABI_TRACKER_VGID = 5, }; -struct lttng_kernel_tracker_args { - uint32_t type; /* enum lttng_kernel_tracker_type */ +struct lttng_kernel_abi_tracker_args { + uint32_t type; /* enum lttng_kernel_abi_tracker_type */ int32_t id; }; /* LTTng file descriptor ioctl */ /* lttng/abi-old.h reserve 0x40, 0x41, 0x42, 0x43, and 0x44. */ -#define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45) -#define LTTNG_KERNEL_TRACER_VERSION \ - _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version) -#define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47) -#define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48) -#define LTTNG_KERNEL_CALIBRATE \ - _IOWR(0xF6, 0x49, struct lttng_kernel_calibrate) -#define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A) -#define LTTNG_KERNEL_TRACER_ABI_VERSION \ - _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version) -#define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C) +#define LTTNG_KERNEL_ABI_SESSION _IO(0xF6, 0x45) +#define LTTNG_KERNEL_ABI_TRACER_VERSION \ + _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version) +#define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47) +#define LTTNG_KERNEL_ABI_WAIT_QUIESCENT _IO(0xF6, 0x48) +#define LTTNG_KERNEL_ABI_CALIBRATE \ + _IOWR(0xF6, 0x49, struct lttng_kernel_abi_calibrate) +#define LTTNG_KERNEL_ABI_SYSCALL_LIST _IO(0xF6, 0x4A) +#define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \ + _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version) +#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C) /* Session FD ioctl */ /* lttng/abi-old.h reserve 0x50, 0x51, 0x52, and 0x53. */ -#define LTTNG_KERNEL_METADATA \ - _IOW(0xF6, 0x54, struct lttng_kernel_channel) -#define LTTNG_KERNEL_CHANNEL \ - _IOW(0xF6, 0x55, struct lttng_kernel_channel) -#define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56) -#define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57) -#define LTTNG_KERNEL_SESSION_TRACK_PID \ +#define LTTNG_KERNEL_ABI_METADATA \ + _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel) +#define LTTNG_KERNEL_ABI_CHANNEL \ + _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel) +#define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56) +#define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57) +#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID \ _IOR(0xF6, 0x58, int32_t) -#define LTTNG_KERNEL_SESSION_UNTRACK_PID \ +#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID \ _IOR(0xF6, 0x59, int32_t) /* @@ -377,66 +377,66 @@ struct lttng_kernel_tracker_args { * are generating two different ioctl numbers, but this was not done on * purpose. We should generally try to avoid those duplications. */ -#define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) -#define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59) +#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) +#define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN _IO(0xF6, 0x59) /* lttng/abi-old.h reserve 0x5A and 0x5B. */ -#define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C) -#define LTTNG_KERNEL_SESSION_SET_NAME \ - _IOR(0xF6, 0x5D, struct lttng_kernel_session_name) -#define LTTNG_KERNEL_SESSION_SET_CREATION_TIME \ - _IOR(0xF6, 0x5E, struct lttng_kernel_session_creation_time) +#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C) +#define LTTNG_KERNEL_ABI_SESSION_SET_NAME \ + _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name) +#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \ + _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time) /* Channel FD ioctl */ /* lttng/abi-old.h reserve 0x60 and 0x61. */ -#define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) -#define LTTNG_KERNEL_EVENT \ - _IOW(0xF6, 0x63, struct lttng_kernel_event) -#define LTTNG_KERNEL_SYSCALL_MASK \ - _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask) +#define LTTNG_KERNEL_ABI_STREAM _IO(0xF6, 0x62) +#define LTTNG_KERNEL_ABI_EVENT \ + _IOW(0xF6, 0x63, struct lttng_kernel_abi_event) +#define LTTNG_KERNEL_ABI_SYSCALL_MASK \ + _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask) /* Event and Channel FD ioctl */ /* lttng/abi-old.h reserve 0x70. */ -#define LTTNG_KERNEL_CONTEXT \ - _IOW(0xF6, 0x71, struct lttng_kernel_context) +#define LTTNG_KERNEL_ABI_CONTEXT \ + _IOW(0xF6, 0x71, struct lttng_kernel_abi_context) /* Event, Event notifier, Channel, Counter and Session ioctl */ /* lttng/abi-old.h reserve 0x80 and 0x81. */ -#define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82) -#define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83) +#define LTTNG_KERNEL_ABI_ENABLE _IO(0xF6, 0x82) +#define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83) /* Trigger group and session ioctl */ -#define LTTNG_KERNEL_COUNTER \ - _IOW(0xF6, 0x84, struct lttng_kernel_counter_conf) +#define LTTNG_KERNEL_ABI_COUNTER \ + _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf) /* Event and Event notifier FD ioctl */ -#define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90) -#define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91) +#define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90) +#define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91) /* Session FD ioctl (continued) */ -#define LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS \ - _IOR(0xF6, 0xA0, struct lttng_kernel_tracker_args) -#define LTTNG_KERNEL_SESSION_TRACK_ID \ - _IOR(0xF6, 0xA1, struct lttng_kernel_tracker_args) -#define LTTNG_KERNEL_SESSION_UNTRACK_ID \ - _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args) +#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \ + _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args) +#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID \ + _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args) +#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID \ + _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args) /* Event notifier group file descriptor ioctl */ -#define LTTNG_KERNEL_EVENT_NOTIFIER_CREATE \ - _IOW(0xF6, 0xB0, struct lttng_kernel_event_notifier) -#define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \ +#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \ + _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier) +#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \ _IO(0xF6, 0xB1) /* Event notifier file descriptor ioctl */ -#define LTTNG_KERNEL_CAPTURE _IO(0xF6, 0xB8) +#define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8) /* Counter file descriptor ioctl */ -#define LTTNG_KERNEL_COUNTER_READ \ - _IOWR(0xF6, 0xC0, struct lttng_kernel_counter_read) -#define LTTNG_KERNEL_COUNTER_AGGREGATE \ - _IOWR(0xF6, 0xC1, struct lttng_kernel_counter_aggregate) -#define LTTNG_KERNEL_COUNTER_CLEAR \ - _IOW(0xF6, 0xC2, struct lttng_kernel_counter_clear) +#define LTTNG_KERNEL_ABI_COUNTER_READ \ + _IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read) +#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \ + _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate) +#define LTTNG_KERNEL_ABI_COUNTER_CLEAR \ + _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear) /* @@ -447,52 +447,52 @@ struct lttng_kernel_tracker_args { */ /* returns the timestamp begin of the current sub-buffer */ -#define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t) /* returns the timestamp end of the current sub-buffer */ -#define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t) /* returns the number of events discarded of the current sub-buffer */ -#define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t) /* returns the packet payload size of the current sub-buffer */ -#define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t) /* returns the packet size of the current sub-buffer*/ -#define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t) /* returns the stream id (invariant for the stream) */ -#define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t) /* returns the current timestamp as perceived from the tracer */ -#define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) /* returns the packet sequence number of the current sub-buffer */ -#define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) /* returns the stream instance id (invariant for the stream) */ -#define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t) #ifdef CONFIG_COMPAT /* returns the timestamp begin of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \ - LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN /* returns the timestamp end of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \ - LTTNG_RING_BUFFER_GET_TIMESTAMP_END +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END /* returns the number of events discarded of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \ - LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED /* returns the packet payload size of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \ - LTTNG_RING_BUFFER_GET_CONTENT_SIZE +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE /* returns the packet size of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_PACKET_SIZE \ - LTTNG_RING_BUFFER_GET_PACKET_SIZE +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PACKET_SIZE \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE /* returns the stream id (invariant for the stream) */ -#define LTTNG_RING_BUFFER_COMPAT_GET_STREAM_ID \ - LTTNG_RING_BUFFER_GET_STREAM_ID +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_STREAM_ID \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID /* returns the current timestamp as perceived from the tracer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \ - LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP /* returns the packet sequence number of the current sub-buffer */ -#define LTTNG_RING_BUFFER_COMPAT_GET_SEQ_NUM \ - LTTNG_RING_BUFFER_GET_SEQ_NUM +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SEQ_NUM \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM /* returns the stream instance id (invariant for the stream) */ -#define LTTNG_RING_BUFFER_COMPAT_INSTANCE_ID \ - LTTNG_RING_BUFFER_INSTANCE_ID +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_INSTANCE_ID \ + LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID #endif /* CONFIG_COMPAT */ #endif /* _LTTNG_ABI_H */ diff --git a/include/lttng/events.h b/include/lttng/events.h index 7fbc8879..12d6f763 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -478,7 +478,7 @@ struct lttng_event { const struct lttng_kernel_event_desc *desc; void *filter; struct lttng_kernel_ctx *ctx; - enum lttng_kernel_instrumentation instrumentation; + enum lttng_kernel_abi_instrumentation instrumentation; union { struct lttng_kprobe kprobe; struct { @@ -519,7 +519,7 @@ struct lttng_event_notifier { void *filter; struct list_head list; /* event_notifier list in event_notifier group */ - enum lttng_kernel_instrumentation instrumentation; + enum lttng_kernel_abi_instrumentation instrumentation; union { struct lttng_kprobe kprobe; struct lttng_uprobe uprobe; @@ -566,7 +566,7 @@ struct lttng_enabler { /* head list of struct lttng_bytecode_node */ struct list_head filter_bytecode_head; - struct lttng_kernel_event event_param; + struct lttng_kernel_abi_event event_param; unsigned int enabled:1; uint64_t user_token; /* User-provided token. */ @@ -832,8 +832,8 @@ struct lttng_session { struct list_head enablers_head; /* Hash table of events */ struct lttng_event_ht events_ht; - char name[LTTNG_KERNEL_SESSION_NAME_LEN]; - char creation_time[LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN]; + char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN]; + char creation_time[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN]; }; struct lttng_counter { @@ -900,7 +900,7 @@ struct list_head *lttng_get_probe_list_head(void); struct lttng_event_enabler *lttng_event_enabler_create( enum lttng_enabler_format_type format_type, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, struct lttng_channel *chan); int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler); @@ -908,7 +908,7 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler); struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( struct lttng_event_notifier_group *event_notifier_group, enum lttng_enabler_format_type format_type, - struct lttng_kernel_event_notifier *event_notifier_param); + struct lttng_kernel_abi_event_notifier *event_notifier_param); int lttng_event_notifier_enabler_enable( struct lttng_event_notifier_enabler *event_notifier_enabler); @@ -943,7 +943,7 @@ int lttng_kernel_counter_clear(struct lttng_counter *counter, struct lttng_event_notifier_group *lttng_event_notifier_group_create(void); int lttng_event_notifier_group_create_error_counter( struct file *event_notifier_group_file, - const struct lttng_kernel_counter_conf *error_counter_conf); + const struct lttng_kernel_abi_counter_conf *error_counter_conf); void lttng_event_notifier_group_destroy( struct lttng_event_notifier_group *event_notifier_group); @@ -962,17 +962,17 @@ struct lttng_channel *lttng_global_channel_create(struct lttng_session *session, void lttng_metadata_channel_destroy(struct lttng_channel *chan); struct lttng_event *lttng_event_create(struct lttng_channel *chan, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, void *filter, const struct lttng_kernel_event_desc *event_desc, - enum lttng_kernel_instrumentation itype); + enum lttng_kernel_abi_instrumentation itype); struct lttng_event *_lttng_event_create(struct lttng_channel *chan, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, void *filter, const struct lttng_kernel_event_desc *event_desc, - enum lttng_kernel_instrumentation itype); + enum lttng_kernel_abi_instrumentation itype); struct lttng_event *lttng_event_compat_old_create(struct lttng_channel *chan, - struct lttng_kernel_old_event *old_event_param, + struct lttng_kernel_abi_old_event *old_event_param, void *filter, const struct lttng_kernel_event_desc *internal_desc); @@ -981,17 +981,17 @@ struct lttng_event_notifier *lttng_event_notifier_create( uint64_t id, uint64_t error_counter_idx, struct lttng_event_notifier_group *event_notifier_group, - struct lttng_kernel_event_notifier *event_notifier_param, + struct lttng_kernel_abi_event_notifier *event_notifier_param, void *filter, - enum lttng_kernel_instrumentation itype); + enum lttng_kernel_abi_instrumentation itype); struct lttng_event_notifier *_lttng_event_notifier_create( const struct lttng_kernel_event_desc *event_notifier_desc, uint64_t id, uint64_t error_counter_idx, struct lttng_event_notifier_group *event_notifier_group, - struct lttng_kernel_event_notifier *event_notifier_param, + struct lttng_kernel_abi_event_notifier *event_notifier_param, void *filter, - enum lttng_kernel_instrumentation itype); + enum lttng_kernel_abi_instrumentation itype); int lttng_channel_enable(struct lttng_channel *channel); int lttng_channel_disable(struct lttng_channel *channel); @@ -1056,7 +1056,7 @@ int lttng_syscall_filter_disable_event( struct lttng_event *event); long lttng_channel_syscall_mask(struct lttng_channel *channel, - struct lttng_kernel_syscall_mask __user *usyscall_mask); + struct lttng_kernel_abi_syscall_mask __user *usyscall_mask); int lttng_syscalls_register_event_notifier( struct lttng_event_notifier_enabler *event_notifier_enabler, @@ -1130,13 +1130,13 @@ static inline int lttng_syscall_filter_disable_event_notifier( #endif int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler, - struct lttng_kernel_filter_bytecode __user *bytecode); + struct lttng_kernel_abi_filter_bytecode __user *bytecode); int lttng_event_notifier_enabler_attach_filter_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_kernel_filter_bytecode __user *bytecode); + struct lttng_kernel_abi_filter_bytecode __user *bytecode); int lttng_event_notifier_enabler_attach_capture_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_kernel_capture_bytecode __user *bytecode); + struct lttng_kernel_abi_capture_bytecode __user *bytecode); void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc, struct lttng_kernel_ctx *ctx, @@ -1388,22 +1388,22 @@ void lttng_kprobes_destroy_event_notifier_private(struct lttng_event_notifier *e #endif int lttng_event_add_callsite(struct lttng_event *event, - struct lttng_kernel_event_callsite *callsite); + struct lttng_kernel_abi_event_callsite __user *callsite); int lttng_event_notifier_add_callsite(struct lttng_event_notifier *event_notifier, - struct lttng_kernel_event_callsite *callsite); + struct lttng_kernel_abi_event_callsite __user *callsite); #ifdef CONFIG_UPROBES int lttng_uprobes_register_event(const char *name, int fd, struct lttng_event *event); int lttng_uprobes_event_add_callsite(struct lttng_event *event, - struct lttng_kernel_event_callsite *callsite); + struct lttng_kernel_abi_event_callsite __user *callsite); void lttng_uprobes_unregister_event(struct lttng_event *event); void lttng_uprobes_destroy_event_private(struct lttng_event *event); int lttng_uprobes_register_event_notifier(const char *name, int fd, struct lttng_event_notifier *event_notifier); int lttng_uprobes_event_notifier_add_callsite(struct lttng_event_notifier *event_notifier, - struct lttng_kernel_event_callsite *callsite); + struct lttng_kernel_abi_event_callsite __user *callsite); void lttng_uprobes_unregister_event_notifier(struct lttng_event_notifier *event_notifier); void lttng_uprobes_destroy_event_notifier_private(struct lttng_event_notifier *event_notifier); #else @@ -1416,7 +1416,7 @@ int lttng_uprobes_register_event(const char *name, static inline int lttng_uprobes_event_add_callsite(struct lttng_event *event, - struct lttng_kernel_event_callsite *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { return -ENOSYS; } @@ -1440,7 +1440,7 @@ int lttng_uprobes_register_event_notifier(const char *name, static inline int lttng_uprobes_event_notifier_add_callsite(struct lttng_event_notifier *event_notifier, - struct lttng_kernel_event_callsite *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { return -ENOSYS; } @@ -1497,7 +1497,7 @@ int lttng_kretprobes_event_enable_state(struct lttng_event *event, } #endif -int lttng_calibrate(struct lttng_kernel_calibrate *calibrate); +int lttng_calibrate(struct lttng_kernel_abi_calibrate *calibrate); extern const struct file_operations lttng_tracepoint_list_fops; extern const struct file_operations lttng_syscall_list_fops; diff --git a/include/ringbuffer/vfs.h b/include/ringbuffer/vfs.h index b0e8bff6..f223aa68 100644 --- a/include/ringbuffer/vfs.h +++ b/include/ringbuffer/vfs.h @@ -53,14 +53,14 @@ ssize_t vfs_lib_ring_buffer_splice_read(struct file *in, loff_t *ppos, unsigned int flags); /* - * Use RING_BUFFER_GET_NEXT_SUBBUF / RING_BUFFER_PUT_NEXT_SUBBUF to read and + * Use LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF / LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF to read and * consume sub-buffers sequentially. * * Reading sub-buffers without consuming them can be performed with: * - * RING_BUFFER_SNAPSHOT - * RING_BUFFER_SNAPSHOT_GET_CONSUMED - * RING_BUFFER_SNAPSHOT_GET_PRODUCED + * LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT + * LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED + * LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED * * to get the offset range to consume, and then by passing each sub-buffer * offset to RING_BUFFER_GET_SUBBUF, read the sub-buffer, and then release it @@ -71,109 +71,109 @@ ssize_t vfs_lib_ring_buffer_splice_read(struct file *in, loff_t *ppos, */ /* Get a snapshot of the current ring buffer producer and consumer positions */ -#define RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00) +#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00) /* Get the consumer position (iteration start) */ -#define RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long) /* Get the producer position (iteration end) */ -#define RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long) /* Get exclusive read access to the specified sub-buffer position */ -#define RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long) /* Release exclusive sub-buffer access */ -#define RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04) +#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04) /* Get exclusive read access to the next sub-buffer that can be read. */ -#define RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05) /* Release exclusive sub-buffer access, move consumer forward. */ -#define RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06) +#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06) /* returns the size of the current sub-buffer, without padding (for mmap). */ -#define RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long) /* returns the size of the current sub-buffer, with padding (for splice). */ -#define RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long) /* returns the maximum size for sub-buffers. */ -#define RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long) /* returns the length to mmap. */ -#define RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long) /* returns the offset of the subbuffer belonging to the mmap reader. */ -#define RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long) /* Flush the current sub-buffer, if non-empty. */ -#define RING_BUFFER_FLUSH _IO(0xF6, 0x0C) +#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH _IO(0xF6, 0x0C) /* Get the current version of the metadata cache (after a get_next). */ -#define RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t) /* * Get a snapshot of the current ring buffer producer and consumer positions, * regardless of whether or not the two positions are contained within the same * sub-buffer. */ -#define RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E) +#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E) /* Flush the current sub-buffer, even if empty. */ -#define RING_BUFFER_FLUSH_EMPTY _IO(0xF6, 0x0F) +#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY _IO(0xF6, 0x0F) /* * Reset the position of what has been consumed from the metadata cache to 0 * so it can be read again. */ -#define RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10) +#define LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10) /* Clear ring buffer content. */ -#define RING_BUFFER_CLEAR _IO(0xF6, 0x11) +#define LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR _IO(0xF6, 0x11) /* * Get next metadata subbuffer, returning a flag indicating whether the * metadata is guaranteed to be in a consistent state at the end of this * sub-buffer (can be parsed). */ -#define RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK _IOR(0xF6, 0x12, uint32_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK _IOR(0xF6, 0x12, uint32_t) #ifdef CONFIG_COMPAT /* Get a snapshot of the current ring buffer producer and consumer positions */ -#define RING_BUFFER_COMPAT_SNAPSHOT RING_BUFFER_SNAPSHOT +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT /* Get the consumer position (iteration start) */ -#define RING_BUFFER_COMPAT_SNAPSHOT_GET_CONSUMED \ +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_GET_CONSUMED \ _IOR(0xF6, 0x01, compat_ulong_t) /* Get the producer position (iteration end) */ -#define RING_BUFFER_COMPAT_SNAPSHOT_GET_PRODUCED \ +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_GET_PRODUCED \ _IOR(0xF6, 0x02, compat_ulong_t) /* Get exclusive read access to the specified sub-buffer position */ -#define RING_BUFFER_COMPAT_GET_SUBBUF _IOW(0xF6, 0x03, compat_ulong_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SUBBUF _IOW(0xF6, 0x03, compat_ulong_t) /* Release exclusive sub-buffer access */ -#define RING_BUFFER_COMPAT_PUT_SUBBUF RING_BUFFER_PUT_SUBBUF +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_PUT_SUBBUF LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF /* Get exclusive read access to the next sub-buffer that can be read. */ -#define RING_BUFFER_COMPAT_GET_NEXT_SUBBUF RING_BUFFER_GET_NEXT_SUBBUF +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_NEXT_SUBBUF LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF /* Release exclusive sub-buffer access, move consumer forward. */ -#define RING_BUFFER_COMPAT_PUT_NEXT_SUBBUF RING_BUFFER_PUT_NEXT_SUBBUF +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_PUT_NEXT_SUBBUF LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF /* returns the size of the current sub-buffer, without padding (for mmap). */ -#define RING_BUFFER_COMPAT_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, compat_ulong_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, compat_ulong_t) /* returns the size of the current sub-buffer, with padding (for splice). */ -#define RING_BUFFER_COMPAT_GET_PADDED_SUBBUF_SIZE \ +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PADDED_SUBBUF_SIZE \ _IOR(0xF6, 0x08, compat_ulong_t) /* returns the maximum size for sub-buffers. */ -#define RING_BUFFER_COMPAT_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, compat_ulong_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, compat_ulong_t) /* returns the length to mmap. */ -#define RING_BUFFER_COMPAT_GET_MMAP_LEN _IOR(0xF6, 0x0A, compat_ulong_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MMAP_LEN _IOR(0xF6, 0x0A, compat_ulong_t) /* returns the offset of the subbuffer belonging to the mmap reader. */ -#define RING_BUFFER_COMPAT_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, compat_ulong_t) +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, compat_ulong_t) /* Flush the current sub-buffer, if non-empty. */ -#define RING_BUFFER_COMPAT_FLUSH RING_BUFFER_FLUSH +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_FLUSH LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH /* Get the current version of the metadata cache (after a get_next). */ -#define RING_BUFFER_COMPAT_GET_METADATA_VERSION RING_BUFFER_GET_METADATA_VERSION +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_METADATA_VERSION LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION /* * Get a snapshot of the current ring buffer producer and consumer positions, * regardless of whether or not the two positions are contained within the same * sub-buffer. */ -#define RING_BUFFER_COMPAT_SNAPSHOT_SAMPLE_POSITIONS \ - RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_SAMPLE_POSITIONS \ + LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS /* Flush the current sub-buffer, even if empty. */ -#define RING_BUFFER_COMPAT_FLUSH_EMPTY \ - RING_BUFFER_FLUSH_EMPTY +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_FLUSH_EMPTY \ + LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY /* Clear ring buffer content. */ -#define RING_BUFFER_COMPAT_CLEAR \ - RING_BUFFER_CLEAR +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_CLEAR \ + LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR /* * Get next metadata subbuffer, returning a flag indicating whether the * metadata is guaranteed to be in a consistent state at the end of this * sub-buffer (can be parsed). */ -#define RING_BUFFER_COMPAT_GET_NEXT_SUBBUF_METADATA_CHECK \ - RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK +#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_NEXT_SUBBUF_METADATA_CHECK \ + LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK #endif /* CONFIG_COMPAT */ -#endif /* _LIB_RING_BUFFER_VFS_H */ +#endif /* _LIB_LTTNG_KERNEL_ABI_RING_BUFFER_VFS_H */ diff --git a/src/lib/ringbuffer/ring_buffer_vfs.c b/src/lib/ringbuffer/ring_buffer_vfs.c index e5d6a701..9d81b33e 100644 --- a/src/lib/ringbuffer/ring_buffer_vfs.c +++ b/src/lib/ringbuffer/ring_buffer_vfs.c @@ -177,17 +177,17 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, return -EIO; switch (cmd) { - case RING_BUFFER_SNAPSHOT: + case LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT: return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot, &buf->prod_snapshot); - case RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS: + case LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS: return lib_ring_buffer_snapshot_sample_positions(buf, &buf->cons_snapshot, &buf->prod_snapshot); - case RING_BUFFER_SNAPSHOT_GET_CONSUMED: + case LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED: return put_ulong(buf->cons_snapshot, arg); - case RING_BUFFER_SNAPSHOT_GET_PRODUCED: + case LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED: return put_ulong(buf->prod_snapshot, arg); - case RING_BUFFER_GET_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF: { unsigned long uconsume; long ret; @@ -202,11 +202,11 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, } return ret; } - case RING_BUFFER_PUT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF: lib_ring_buffer_put_subbuf(buf); return 0; - case RING_BUFFER_GET_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF: { long ret; @@ -217,13 +217,13 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, } return ret; } - case RING_BUFFER_PUT_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF: lib_ring_buffer_put_next_subbuf(buf); return 0; - case RING_BUFFER_GET_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE: return put_ulong(lib_ring_buffer_get_read_data_size(config, buf), arg); - case RING_BUFFER_GET_PADDED_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE: { unsigned long size; @@ -231,9 +231,9 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, size = PAGE_ALIGN(size); return put_ulong(size, arg); } - case RING_BUFFER_GET_MAX_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE: return put_ulong(chan->backend.subbuf_size, arg); - case RING_BUFFER_GET_MMAP_LEN: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN: { unsigned long mmap_buf_len; @@ -246,7 +246,7 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, return -EFBIG; return put_ulong(mmap_buf_len, arg); } - case RING_BUFFER_GET_MMAP_READ_OFFSET: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET: { unsigned long sb_bindex; @@ -257,13 +257,13 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, return put_ulong(buf->backend.array[sb_bindex]->mmap_offset, arg); } - case RING_BUFFER_FLUSH: + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH: lib_ring_buffer_switch_remote(buf); return 0; - case RING_BUFFER_FLUSH_EMPTY: + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: lib_ring_buffer_switch_remote_empty(buf); return 0; - case RING_BUFFER_CLEAR: + case LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR: lib_ring_buffer_clear(buf); return 0; default: @@ -281,18 +281,18 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_ioctl); * * This ioctl implements commands necessary for producer/consumer * and flight recorder reader interaction : - * RING_BUFFER_GET_NEXT_SUBBUF + * LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF * Get the next sub-buffer that can be read. It never blocks. - * RING_BUFFER_PUT_NEXT_SUBBUF + * LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF * Release the currently read sub-buffer. - * RING_BUFFER_GET_SUBBUF_SIZE + * LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE * returns the size of the current sub-buffer. - * RING_BUFFER_GET_MAX_SUBBUF_SIZE + * LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE * returns the maximum size for sub-buffers. - * RING_BUFFER_GET_NUM_SUBBUF + * LTTNG_KERNEL_ABI_RING_BUFFER_GET_NUM_SUBBUF * returns the number of reader-visible sub-buffers in the per cpu * channel (for mmap). - * RING_BUFFER_GET_MMAP_READ_OFFSET + * LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET * returns the offset of the subbuffer belonging to the reader. * Should only be used for mmap clients. */ @@ -315,17 +315,17 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EIO; switch (cmd) { - case RING_BUFFER_COMPAT_SNAPSHOT: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT: return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot, &buf->prod_snapshot); - case RING_BUFFER_COMPAT_SNAPSHOT_SAMPLE_POSITIONS: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_SAMPLE_POSITIONS: return lib_ring_buffer_snapshot_sample_positions(buf, &buf->cons_snapshot, &buf->prod_snapshot); - case RING_BUFFER_COMPAT_SNAPSHOT_GET_CONSUMED: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_GET_CONSUMED: return compat_put_ulong(buf->cons_snapshot, arg); - case RING_BUFFER_COMPAT_SNAPSHOT_GET_PRODUCED: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_SNAPSHOT_GET_PRODUCED: return compat_put_ulong(buf->prod_snapshot, arg); - case RING_BUFFER_COMPAT_GET_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SUBBUF: { __u32 uconsume; unsigned long consume; @@ -344,11 +344,11 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, } return ret; } - case RING_BUFFER_COMPAT_PUT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_PUT_SUBBUF: lib_ring_buffer_put_subbuf(buf); return 0; - case RING_BUFFER_COMPAT_GET_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_NEXT_SUBBUF: { long ret; @@ -359,10 +359,10 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, } return ret; } - case RING_BUFFER_COMPAT_PUT_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_PUT_NEXT_SUBBUF: lib_ring_buffer_put_next_subbuf(buf); return 0; - case RING_BUFFER_COMPAT_GET_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SUBBUF_SIZE: { unsigned long data_size; @@ -371,7 +371,7 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EFBIG; return compat_put_ulong(data_size, arg); } - case RING_BUFFER_COMPAT_GET_PADDED_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PADDED_SUBBUF_SIZE: { unsigned long size; @@ -381,11 +381,11 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EFBIG; return compat_put_ulong(size, arg); } - case RING_BUFFER_COMPAT_GET_MAX_SUBBUF_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MAX_SUBBUF_SIZE: if (chan->backend.subbuf_size > UINT_MAX) return -EFBIG; return compat_put_ulong(chan->backend.subbuf_size, arg); - case RING_BUFFER_COMPAT_GET_MMAP_LEN: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MMAP_LEN: { unsigned long mmap_buf_len; @@ -398,7 +398,7 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EFBIG; return compat_put_ulong(mmap_buf_len, arg); } - case RING_BUFFER_COMPAT_GET_MMAP_READ_OFFSET: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_MMAP_READ_OFFSET: { unsigned long sb_bindex, read_offset; @@ -411,13 +411,13 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EINVAL; return compat_put_ulong(read_offset, arg); } - case RING_BUFFER_COMPAT_FLUSH: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_FLUSH: lib_ring_buffer_switch_remote(buf); return 0; - case RING_BUFFER_COMPAT_FLUSH_EMPTY: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_FLUSH_EMPTY: lib_ring_buffer_switch_remote_empty(buf); return 0; - case RING_BUFFER_COMPAT_CLEAR: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_CLEAR: lib_ring_buffer_clear(buf); return 0; default: diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 13d737d9..4e0003be 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -241,7 +241,7 @@ fd_error: #endif static -void lttng_abi_tracer_version(struct lttng_kernel_tracer_version *v) +void lttng_abi_tracer_version(struct lttng_kernel_abi_tracer_version *v) { v->major = LTTNG_MODULES_MAJOR_VERSION; v->minor = LTTNG_MODULES_MINOR_VERSION; @@ -249,15 +249,15 @@ void lttng_abi_tracer_version(struct lttng_kernel_tracer_version *v) } static -void lttng_abi_tracer_abi_version(struct lttng_kernel_tracer_abi_version *v) +void lttng_abi_tracer_abi_version(struct lttng_kernel_abi_tracer_abi_version *v) { - v->major = LTTNG_MODULES_ABI_MAJOR_VERSION; - v->minor = LTTNG_MODULES_ABI_MINOR_VERSION; + v->major = LTTNG_KERNEL_ABI_MAJOR_VERSION; + v->minor = LTTNG_KERNEL_ABI_MINOR_VERSION; } static long lttng_abi_add_context(struct file *file, - struct lttng_kernel_context *context_param, + struct lttng_kernel_abi_context *context_param, struct lttng_kernel_ctx **ctx, struct lttng_session *session) { @@ -265,84 +265,84 @@ long lttng_abi_add_context(struct file *file, return -EPERM; switch (context_param->ctx) { - case LTTNG_KERNEL_CONTEXT_PID: + case LTTNG_KERNEL_ABI_CONTEXT_PID: return lttng_add_pid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_PRIO: + case LTTNG_KERNEL_ABI_CONTEXT_PRIO: return lttng_add_prio_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_NICE: + case LTTNG_KERNEL_ABI_CONTEXT_NICE: return lttng_add_nice_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VPID: + case LTTNG_KERNEL_ABI_CONTEXT_VPID: return lttng_add_vpid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_TID: + case LTTNG_KERNEL_ABI_CONTEXT_TID: return lttng_add_tid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VTID: + case LTTNG_KERNEL_ABI_CONTEXT_VTID: return lttng_add_vtid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_PPID: + case LTTNG_KERNEL_ABI_CONTEXT_PPID: return lttng_add_ppid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VPPID: + case LTTNG_KERNEL_ABI_CONTEXT_VPPID: return lttng_add_vppid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_PERF_COUNTER: - context_param->u.perf_counter.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + case LTTNG_KERNEL_ABI_CONTEXT_PERF_COUNTER: + context_param->u.perf_counter.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; return lttng_add_perf_counter_to_ctx(context_param->u.perf_counter.type, context_param->u.perf_counter.config, context_param->u.perf_counter.name, ctx); - case LTTNG_KERNEL_CONTEXT_PROCNAME: + case LTTNG_KERNEL_ABI_CONTEXT_PROCNAME: return lttng_add_procname_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_HOSTNAME: + case LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME: return lttng_add_hostname_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_CPU_ID: + case LTTNG_KERNEL_ABI_CONTEXT_CPU_ID: return lttng_add_cpu_id_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_INTERRUPTIBLE: + case LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE: return lttng_add_interruptible_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_NEED_RESCHEDULE: + case LTTNG_KERNEL_ABI_CONTEXT_NEED_RESCHEDULE: return lttng_add_need_reschedule_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_PREEMPTIBLE: + case LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE: return lttng_add_preemptible_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_MIGRATABLE: + case LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE: return lttng_add_migratable_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL: - case LTTNG_KERNEL_CONTEXT_CALLSTACK_USER: + case LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL: + case LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER: return lttng_add_callstack_to_ctx(ctx, context_param->ctx); - case LTTNG_KERNEL_CONTEXT_CGROUP_NS: + case LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS: return lttng_add_cgroup_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_IPC_NS: + case LTTNG_KERNEL_ABI_CONTEXT_IPC_NS: return lttng_add_ipc_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_MNT_NS: + case LTTNG_KERNEL_ABI_CONTEXT_MNT_NS: return lttng_add_mnt_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_NET_NS: + case LTTNG_KERNEL_ABI_CONTEXT_NET_NS: return lttng_add_net_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_PID_NS: + case LTTNG_KERNEL_ABI_CONTEXT_PID_NS: return lttng_add_pid_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_USER_NS: + case LTTNG_KERNEL_ABI_CONTEXT_USER_NS: return lttng_add_user_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_UTS_NS: + case LTTNG_KERNEL_ABI_CONTEXT_UTS_NS: return lttng_add_uts_ns_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_UID: + case LTTNG_KERNEL_ABI_CONTEXT_UID: return lttng_add_uid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_EUID: + case LTTNG_KERNEL_ABI_CONTEXT_EUID: return lttng_add_euid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_SUID: + case LTTNG_KERNEL_ABI_CONTEXT_SUID: return lttng_add_suid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_GID: + case LTTNG_KERNEL_ABI_CONTEXT_GID: return lttng_add_gid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_EGID: + case LTTNG_KERNEL_ABI_CONTEXT_EGID: return lttng_add_egid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_SGID: + case LTTNG_KERNEL_ABI_CONTEXT_SGID: return lttng_add_sgid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VUID: + case LTTNG_KERNEL_ABI_CONTEXT_VUID: return lttng_add_vuid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VEUID: + case LTTNG_KERNEL_ABI_CONTEXT_VEUID: return lttng_add_veuid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VSUID: + case LTTNG_KERNEL_ABI_CONTEXT_VSUID: return lttng_add_vsuid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VGID: + case LTTNG_KERNEL_ABI_CONTEXT_VGID: return lttng_add_vgid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VEGID: + case LTTNG_KERNEL_ABI_CONTEXT_VEGID: return lttng_add_vegid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_VSGID: + case LTTNG_KERNEL_ABI_CONTEXT_VSGID: return lttng_add_vsgid_to_ctx(ctx); - case LTTNG_KERNEL_CONTEXT_TIME_NS: + case LTTNG_KERNEL_ABI_CONTEXT_TIME_NS: return lttng_add_time_ns_to_ctx(ctx); default: return -EINVAL; @@ -357,17 +357,17 @@ long lttng_abi_add_context(struct file *file, * @arg: command arg * * This ioctl implements lttng commands: - * LTTNG_KERNEL_SESSION + * LTTNG_KERNEL_ABI_SESSION * Returns a LTTng trace session file descriptor - * LTTNG_KERNEL_TRACER_VERSION + * LTTNG_KERNEL_ABI_TRACER_VERSION * Returns the LTTng kernel tracer version - * LTTNG_KERNEL_TRACEPOINT_LIST + * LTTNG_KERNEL_ABI_TRACEPOINT_LIST * Returns a file descriptor listing available tracepoints - * LTTNG_KERNEL_WAIT_QUIESCENT + * LTTNG_KERNEL_ABI_WAIT_QUIESCENT * Returns after all previously running probes have completed - * LTTNG_KERNEL_TRACER_ABI_VERSION + * LTTNG_KERNEL_ABI_TRACER_ABI_VERSION * Returns the LTTng kernel tracer ABI version - * LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE + * LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE * Returns a LTTng event notifier group file descriptor * * The returned session will be deleted when its file descriptor is closed. @@ -376,17 +376,17 @@ static long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { switch (cmd) { - case LTTNG_KERNEL_OLD_SESSION: - case LTTNG_KERNEL_SESSION: + case LTTNG_KERNEL_ABI_OLD_SESSION: + case LTTNG_KERNEL_ABI_SESSION: return lttng_abi_create_session(); - case LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE: + case LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE: return lttng_abi_create_event_notifier_group(); - case LTTNG_KERNEL_OLD_TRACER_VERSION: + case LTTNG_KERNEL_ABI_OLD_TRACER_VERSION: { - struct lttng_kernel_tracer_version v; - struct lttng_kernel_old_tracer_version oldv; - struct lttng_kernel_old_tracer_version *uversion = - (struct lttng_kernel_old_tracer_version __user *) arg; + struct lttng_kernel_abi_tracer_version v; + struct lttng_kernel_abi_old_tracer_version oldv; + struct lttng_kernel_abi_old_tracer_version *uversion = + (struct lttng_kernel_abi_old_tracer_version __user *) arg; lttng_abi_tracer_version(&v); oldv.major = v.major; @@ -397,11 +397,11 @@ long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return -EFAULT; return 0; } - case LTTNG_KERNEL_TRACER_VERSION: + case LTTNG_KERNEL_ABI_TRACER_VERSION: { - struct lttng_kernel_tracer_version version; - struct lttng_kernel_tracer_version *uversion = - (struct lttng_kernel_tracer_version __user *) arg; + struct lttng_kernel_abi_tracer_version version; + struct lttng_kernel_abi_tracer_version *uversion = + (struct lttng_kernel_abi_tracer_version __user *) arg; lttng_abi_tracer_version(&version); @@ -409,11 +409,11 @@ long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return -EFAULT; return 0; } - case LTTNG_KERNEL_TRACER_ABI_VERSION: + case LTTNG_KERNEL_ABI_TRACER_ABI_VERSION: { - struct lttng_kernel_tracer_abi_version version; - struct lttng_kernel_tracer_abi_version *uversion = - (struct lttng_kernel_tracer_abi_version __user *) arg; + struct lttng_kernel_abi_tracer_abi_version version; + struct lttng_kernel_abi_tracer_abi_version *uversion = + (struct lttng_kernel_abi_tracer_abi_version __user *) arg; lttng_abi_tracer_abi_version(&version); @@ -421,21 +421,21 @@ long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return -EFAULT; return 0; } - case LTTNG_KERNEL_OLD_TRACEPOINT_LIST: - case LTTNG_KERNEL_TRACEPOINT_LIST: + case LTTNG_KERNEL_ABI_OLD_TRACEPOINT_LIST: + case LTTNG_KERNEL_ABI_TRACEPOINT_LIST: return lttng_abi_tracepoint_list(); - case LTTNG_KERNEL_SYSCALL_LIST: + case LTTNG_KERNEL_ABI_SYSCALL_LIST: return lttng_abi_syscall_list(); - case LTTNG_KERNEL_OLD_WAIT_QUIESCENT: - case LTTNG_KERNEL_WAIT_QUIESCENT: + case LTTNG_KERNEL_ABI_OLD_WAIT_QUIESCENT: + case LTTNG_KERNEL_ABI_WAIT_QUIESCENT: synchronize_trace(); return 0; - case LTTNG_KERNEL_OLD_CALIBRATE: + case LTTNG_KERNEL_ABI_OLD_CALIBRATE: { - struct lttng_kernel_old_calibrate __user *ucalibrate = - (struct lttng_kernel_old_calibrate __user *) arg; - struct lttng_kernel_old_calibrate old_calibrate; - struct lttng_kernel_calibrate calibrate; + struct lttng_kernel_abi_old_calibrate __user *ucalibrate = + (struct lttng_kernel_abi_old_calibrate __user *) arg; + struct lttng_kernel_abi_old_calibrate old_calibrate; + struct lttng_kernel_abi_calibrate calibrate; int ret; if (copy_from_user(&old_calibrate, ucalibrate, sizeof(old_calibrate))) @@ -446,11 +446,11 @@ long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return -EFAULT; return ret; } - case LTTNG_KERNEL_CALIBRATE: + case LTTNG_KERNEL_ABI_CALIBRATE: { - struct lttng_kernel_calibrate __user *ucalibrate = - (struct lttng_kernel_calibrate __user *) arg; - struct lttng_kernel_calibrate calibrate; + struct lttng_kernel_abi_calibrate __user *ucalibrate = + (struct lttng_kernel_abi_calibrate __user *) arg; + struct lttng_kernel_abi_calibrate calibrate; int ret; if (copy_from_user(&calibrate, ucalibrate, sizeof(calibrate))) @@ -484,7 +484,7 @@ static const struct file_operations lttng_proc_ops = { static int lttng_abi_create_channel(struct file *session_file, - struct lttng_kernel_channel *chan_param, + struct lttng_kernel_abi_channel *chan_param, enum channel_type channel_type) { struct lttng_session *session = session_file->private_data; @@ -518,10 +518,10 @@ int lttng_abi_create_channel(struct file *session_file, } switch (channel_type) { case PER_CPU_CHANNEL: - if (chan_param->output == LTTNG_KERNEL_SPLICE) { + if (chan_param->output == LTTNG_KERNEL_ABI_SPLICE) { transport_name = chan_param->overwrite ? "relay-overwrite" : "relay-discard"; - } else if (chan_param->output == LTTNG_KERNEL_MMAP) { + } else if (chan_param->output == LTTNG_KERNEL_ABI_MMAP) { transport_name = chan_param->overwrite ? "relay-overwrite-mmap" : "relay-discard-mmap"; } else { @@ -529,9 +529,9 @@ int lttng_abi_create_channel(struct file *session_file, } break; case METADATA_CHANNEL: - if (chan_param->output == LTTNG_KERNEL_SPLICE) + if (chan_param->output == LTTNG_KERNEL_ABI_SPLICE) transport_name = "relay-metadata"; - else if (chan_param->output == LTTNG_KERNEL_MMAP) + else if (chan_param->output == LTTNG_KERNEL_ABI_MMAP) transport_name = "relay-metadata-mmap"; else return -EINVAL; @@ -576,13 +576,13 @@ fd_error: static int lttng_abi_session_set_name(struct lttng_session *session, - struct lttng_kernel_session_name *name) + struct lttng_kernel_abi_session_name *name) { size_t len; - len = strnlen(name->name, LTTNG_KERNEL_SESSION_NAME_LEN); + len = strnlen(name->name, LTTNG_KERNEL_ABI_SESSION_NAME_LEN); - if (len == LTTNG_KERNEL_SESSION_NAME_LEN) { + if (len == LTTNG_KERNEL_ABI_SESSION_NAME_LEN) { /* Name is too long/malformed */ return -EINVAL; } @@ -593,13 +593,13 @@ int lttng_abi_session_set_name(struct lttng_session *session, static int lttng_abi_session_set_creation_time(struct lttng_session *session, - struct lttng_kernel_session_creation_time *time) + struct lttng_kernel_abi_session_creation_time *time) { size_t len; - len = strnlen(time->iso8601, LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN); + len = strnlen(time->iso8601, LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN); - if (len == LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN) { + if (len == LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN) { /* Time is too long/malformed */ return -EINVAL; } @@ -628,15 +628,15 @@ static long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct lttng_counter *counter = file->private_data; - size_t indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX] = { 0 }; + size_t indexes[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX] = { 0 }; int i; switch (cmd) { - case LTTNG_KERNEL_COUNTER_READ: + case LTTNG_KERNEL_ABI_COUNTER_READ: { - struct lttng_kernel_counter_read local_counter_read; - struct lttng_kernel_counter_read __user *ucounter_read = - (struct lttng_kernel_counter_read __user *) arg; + struct lttng_kernel_abi_counter_read local_counter_read; + struct lttng_kernel_abi_counter_read __user *ucounter_read = + (struct lttng_kernel_abi_counter_read __user *) arg; bool overflow, underflow; int64_t value; int32_t cpu; @@ -668,11 +668,11 @@ long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return 0; } - case LTTNG_KERNEL_COUNTER_AGGREGATE: + case LTTNG_KERNEL_ABI_COUNTER_AGGREGATE: { - struct lttng_kernel_counter_aggregate local_counter_aggregate; - struct lttng_kernel_counter_aggregate __user *ucounter_aggregate = - (struct lttng_kernel_counter_aggregate __user *) arg; + struct lttng_kernel_abi_counter_aggregate local_counter_aggregate; + struct lttng_kernel_abi_counter_aggregate __user *ucounter_aggregate = + (struct lttng_kernel_abi_counter_aggregate __user *) arg; bool overflow, underflow; int64_t value; int ret; @@ -702,11 +702,11 @@ long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return 0; } - case LTTNG_KERNEL_COUNTER_CLEAR: + case LTTNG_KERNEL_ABI_COUNTER_CLEAR: { - struct lttng_kernel_counter_clear local_counter_clear; - struct lttng_kernel_counter_clear __user *ucounter_clear = - (struct lttng_kernel_counter_clear __user *) arg; + struct lttng_kernel_abi_counter_clear local_counter_clear; + struct lttng_kernel_abi_counter_clear __user *ucounter_clear = + (struct lttng_kernel_abi_counter_clear __user *) arg; if (copy_from_user(&local_counter_clear, ucounter_clear, sizeof(local_counter_clear))) @@ -738,20 +738,20 @@ static const struct file_operations lttng_counter_fops = { static -enum tracker_type get_tracker_type(struct lttng_kernel_tracker_args *tracker) +enum tracker_type get_tracker_type(struct lttng_kernel_abi_tracker_args *tracker) { switch (tracker->type) { - case LTTNG_KERNEL_TRACKER_PID: + case LTTNG_KERNEL_ABI_TRACKER_PID: return TRACKER_PID; - case LTTNG_KERNEL_TRACKER_VPID: + case LTTNG_KERNEL_ABI_TRACKER_VPID: return TRACKER_VPID; - case LTTNG_KERNEL_TRACKER_UID: + case LTTNG_KERNEL_ABI_TRACKER_UID: return TRACKER_UID; - case LTTNG_KERNEL_TRACKER_VUID: + case LTTNG_KERNEL_ABI_TRACKER_VUID: return TRACKER_VUID; - case LTTNG_KERNEL_TRACKER_GID: + case LTTNG_KERNEL_ABI_TRACKER_GID: return TRACKER_GID; - case LTTNG_KERNEL_TRACKER_VGID: + case LTTNG_KERNEL_ABI_TRACKER_VGID: return TRACKER_VGID; default: return TRACKER_UNKNOWN; @@ -766,21 +766,21 @@ enum tracker_type get_tracker_type(struct lttng_kernel_tracker_args *tracker) * @arg: command arg * * This ioctl implements lttng commands: - * LTTNG_KERNEL_CHANNEL + * LTTNG_KERNEL_ABI_CHANNEL * Returns a LTTng channel file descriptor - * LTTNG_KERNEL_ENABLE + * LTTNG_KERNEL_ABI_ENABLE * Enables tracing for a session (weak enable) - * LTTNG_KERNEL_DISABLE + * LTTNG_KERNEL_ABI_DISABLE * Disables tracing for a session (strong disable) - * LTTNG_KERNEL_METADATA + * LTTNG_KERNEL_ABI_METADATA * Returns a LTTng metadata file descriptor - * LTTNG_KERNEL_SESSION_TRACK_PID + * LTTNG_KERNEL_ABI_SESSION_TRACK_PID * Add PID to session PID tracker - * LTTNG_KERNEL_SESSION_UNTRACK_PID + * LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID * Remove PID from session PID tracker - * LTTNG_KERNEL_SESSION_TRACK_ID + * LTTNG_KERNEL_ABI_SESSION_TRACK_ID * Add ID to tracker - * LTTNG_KERNEL_SESSION_UNTRACK_ID + * LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID * Remove ID from tracker * * The returned channel will be deleted when its file descriptor is closed. @@ -789,15 +789,15 @@ static long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct lttng_session *session = file->private_data; - struct lttng_kernel_channel chan_param; - struct lttng_kernel_old_channel old_chan_param; + struct lttng_kernel_abi_channel chan_param; + struct lttng_kernel_abi_old_channel old_chan_param; switch (cmd) { - case LTTNG_KERNEL_OLD_CHANNEL: + case LTTNG_KERNEL_ABI_OLD_CHANNEL: { if (copy_from_user(&old_chan_param, - (struct lttng_kernel_old_channel __user *) arg, - sizeof(struct lttng_kernel_old_channel))) + (struct lttng_kernel_abi_old_channel __user *) arg, + sizeof(struct lttng_kernel_abi_old_channel))) return -EFAULT; chan_param.overwrite = old_chan_param.overwrite; chan_param.subbuf_size = old_chan_param.subbuf_size; @@ -809,30 +809,30 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_abi_create_channel(file, &chan_param, PER_CPU_CHANNEL); } - case LTTNG_KERNEL_CHANNEL: + case LTTNG_KERNEL_ABI_CHANNEL: { if (copy_from_user(&chan_param, - (struct lttng_kernel_channel __user *) arg, - sizeof(struct lttng_kernel_channel))) + (struct lttng_kernel_abi_channel __user *) arg, + sizeof(struct lttng_kernel_abi_channel))) return -EFAULT; return lttng_abi_create_channel(file, &chan_param, PER_CPU_CHANNEL); } - case LTTNG_KERNEL_OLD_SESSION_START: - case LTTNG_KERNEL_OLD_ENABLE: - case LTTNG_KERNEL_SESSION_START: - case LTTNG_KERNEL_ENABLE: + case LTTNG_KERNEL_ABI_OLD_SESSION_START: + case LTTNG_KERNEL_ABI_OLD_ENABLE: + case LTTNG_KERNEL_ABI_SESSION_START: + case LTTNG_KERNEL_ABI_ENABLE: return lttng_session_enable(session); - case LTTNG_KERNEL_OLD_SESSION_STOP: - case LTTNG_KERNEL_OLD_DISABLE: - case LTTNG_KERNEL_SESSION_STOP: - case LTTNG_KERNEL_DISABLE: + case LTTNG_KERNEL_ABI_OLD_SESSION_STOP: + case LTTNG_KERNEL_ABI_OLD_DISABLE: + case LTTNG_KERNEL_ABI_SESSION_STOP: + case LTTNG_KERNEL_ABI_DISABLE: return lttng_session_disable(session); - case LTTNG_KERNEL_OLD_METADATA: + case LTTNG_KERNEL_ABI_OLD_METADATA: { if (copy_from_user(&old_chan_param, - (struct lttng_kernel_old_channel __user *) arg, - sizeof(struct lttng_kernel_old_channel))) + (struct lttng_kernel_abi_old_channel __user *) arg, + sizeof(struct lttng_kernel_abi_old_channel))) return -EFAULT; chan_param.overwrite = old_chan_param.overwrite; chan_param.subbuf_size = old_chan_param.subbuf_size; @@ -844,41 +844,41 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_abi_create_channel(file, &chan_param, METADATA_CHANNEL); } - case LTTNG_KERNEL_METADATA: + case LTTNG_KERNEL_ABI_METADATA: { if (copy_from_user(&chan_param, - (struct lttng_kernel_channel __user *) arg, - sizeof(struct lttng_kernel_channel))) + (struct lttng_kernel_abi_channel __user *) arg, + sizeof(struct lttng_kernel_abi_channel))) return -EFAULT; return lttng_abi_create_channel(file, &chan_param, METADATA_CHANNEL); } - case LTTNG_KERNEL_SESSION_TRACK_PID: + case LTTNG_KERNEL_ABI_SESSION_TRACK_PID: return lttng_session_track_id(session, TRACKER_PID, (int) arg); - case LTTNG_KERNEL_SESSION_UNTRACK_PID: + case LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID: return lttng_session_untrack_id(session, TRACKER_PID, (int) arg); - case LTTNG_KERNEL_SESSION_TRACK_ID: + case LTTNG_KERNEL_ABI_SESSION_TRACK_ID: { - struct lttng_kernel_tracker_args tracker; + struct lttng_kernel_abi_tracker_args tracker; enum tracker_type tracker_type; if (copy_from_user(&tracker, - (struct lttng_kernel_tracker_args __user *) arg, - sizeof(struct lttng_kernel_tracker_args))) + (struct lttng_kernel_abi_tracker_args __user *) arg, + sizeof(struct lttng_kernel_abi_tracker_args))) return -EFAULT; tracker_type = get_tracker_type(&tracker); if (tracker_type == TRACKER_UNKNOWN) return -EINVAL; return lttng_session_track_id(session, tracker_type, tracker.id); } - case LTTNG_KERNEL_SESSION_UNTRACK_ID: + case LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID: { - struct lttng_kernel_tracker_args tracker; + struct lttng_kernel_abi_tracker_args tracker; enum tracker_type tracker_type; if (copy_from_user(&tracker, - (struct lttng_kernel_tracker_args __user *) arg, - sizeof(struct lttng_kernel_tracker_args))) + (struct lttng_kernel_abi_tracker_args __user *) arg, + sizeof(struct lttng_kernel_abi_tracker_args))) return -EFAULT; tracker_type = get_tracker_type(&tracker); if (tracker_type == TRACKER_UNKNOWN) @@ -886,43 +886,43 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_session_untrack_id(session, tracker_type, tracker.id); } - case LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS: + case LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS: return lttng_session_list_tracker_ids(session, TRACKER_PID); - case LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS: + case LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS: { - struct lttng_kernel_tracker_args tracker; + struct lttng_kernel_abi_tracker_args tracker; enum tracker_type tracker_type; if (copy_from_user(&tracker, - (struct lttng_kernel_tracker_args __user *) arg, - sizeof(struct lttng_kernel_tracker_args))) + (struct lttng_kernel_abi_tracker_args __user *) arg, + sizeof(struct lttng_kernel_abi_tracker_args))) return -EFAULT; tracker_type = get_tracker_type(&tracker); if (tracker_type == TRACKER_UNKNOWN) return -EINVAL; return lttng_session_list_tracker_ids(session, tracker_type); } - case LTTNG_KERNEL_SESSION_METADATA_REGEN: + case LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN: return lttng_session_metadata_regenerate(session); - case LTTNG_KERNEL_SESSION_STATEDUMP: + case LTTNG_KERNEL_ABI_SESSION_STATEDUMP: return lttng_session_statedump(session); - case LTTNG_KERNEL_SESSION_SET_NAME: + case LTTNG_KERNEL_ABI_SESSION_SET_NAME: { - struct lttng_kernel_session_name name; + struct lttng_kernel_abi_session_name name; if (copy_from_user(&name, - (struct lttng_kernel_session_name __user *) arg, - sizeof(struct lttng_kernel_session_name))) + (struct lttng_kernel_abi_session_name __user *) arg, + sizeof(struct lttng_kernel_abi_session_name))) return -EFAULT; return lttng_abi_session_set_name(session, &name); } - case LTTNG_KERNEL_SESSION_SET_CREATION_TIME: + case LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME: { - struct lttng_kernel_session_creation_time time; + struct lttng_kernel_abi_session_creation_time time; if (copy_from_user(&time, - (struct lttng_kernel_session_creation_time __user *) arg, - sizeof(struct lttng_kernel_session_creation_time))) + (struct lttng_kernel_abi_session_creation_time __user *) arg, + sizeof(struct lttng_kernel_abi_session_creation_time))) return -EFAULT; return lttng_abi_session_set_creation_time(session, &time); } @@ -1273,13 +1273,13 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, unsigned int rb_cmd; bool coherent; - if (cmd == RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK) - rb_cmd = RING_BUFFER_GET_NEXT_SUBBUF; + if (cmd == LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK) + rb_cmd = LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF; else rb_cmd = cmd; switch (cmd) { - case RING_BUFFER_GET_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1293,15 +1293,15 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, goto err; break; } - case RING_BUFFER_GET_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF: { /* * Random access is not allowed for metadata channel. */ return -ENOSYS; } - case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ - case RING_BUFFER_FLUSH: + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1316,19 +1316,19 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, goto err; break; } - case RING_BUFFER_GET_METADATA_VERSION: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION: { struct lttng_metadata_stream *stream = filp->private_data; return put_u64(stream->version, arg); } - case RING_BUFFER_METADATA_CACHE_DUMP: + case LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP: { struct lttng_metadata_stream *stream = filp->private_data; return lttng_metadata_cache_dump(stream); } - case RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1354,13 +1354,13 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, goto err; switch (cmd) { - case RING_BUFFER_PUT_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF: { lttng_metadata_ring_buffer_ioctl_put_next_subbuf(filp, cmd, arg); break; } - case RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: { return put_u32(coherent, arg); } @@ -1382,13 +1382,13 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, unsigned int rb_cmd; bool coherent; - if (cmd == RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK) - rb_cmd = RING_BUFFER_GET_NEXT_SUBBUF; + if (cmd == LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK) + rb_cmd = LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF; else rb_cmd = cmd; switch (cmd) { - case RING_BUFFER_GET_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1402,15 +1402,15 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, goto err; break; } - case RING_BUFFER_GET_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF: { /* * Random access is not allowed for metadata channel. */ return -ENOSYS; } - case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ - case RING_BUFFER_FLUSH: + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ + case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1425,19 +1425,19 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, goto err; break; } - case RING_BUFFER_GET_METADATA_VERSION: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION: { struct lttng_metadata_stream *stream = filp->private_data; return put_u64(stream->version, arg); } - case RING_BUFFER_METADATA_CACHE_DUMP: + case LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP: { struct lttng_metadata_stream *stream = filp->private_data; return lttng_metadata_cache_dump(stream); } - case RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; @@ -1463,13 +1463,13 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, goto err; switch (cmd) { - case RING_BUFFER_PUT_NEXT_SUBBUF: + case LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF: { lttng_metadata_ring_buffer_ioctl_put_next_subbuf(filp, cmd, arg); break; } - case RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK: { return put_u32(coherent, arg); } @@ -1720,51 +1720,51 @@ refcount_error: } static -int lttng_abi_validate_event_param(struct lttng_kernel_event *event_param) +int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param) { /* Limit ABI to implemented features. */ switch (event_param->instrumentation) { - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: switch (event_param->u.syscall.entryexit) { - case LTTNG_KERNEL_SYSCALL_ENTRY: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL_EXIT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: break; default: return -EINVAL; } switch (event_param->u.syscall.abi) { - case LTTNG_KERNEL_SYSCALL_ABI_ALL: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL: break; default: return -EINVAL; } switch (event_param->u.syscall.match) { - case LTTNG_KERNEL_SYSCALL_MATCH_NAME: + case LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME: break; default: return -EINVAL; } break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: switch (event_param->u.kretprobe.entryexit) { - case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: break; - case LTTNG_KERNEL_SYSCALL_ENTRY: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL_EXIT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */ default: return -EINVAL; } break; - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: return -EINVAL; } @@ -1773,22 +1773,22 @@ int lttng_abi_validate_event_param(struct lttng_kernel_event *event_param) static int lttng_abi_create_event(struct file *channel_file, - struct lttng_kernel_event *event_param) + struct lttng_kernel_abi_event *event_param) { struct lttng_channel *channel = channel_file->private_data; int event_fd, ret; struct file *event_file; void *priv; - event_param->name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + event_param->name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; switch (event_param->instrumentation) { - case LTTNG_KERNEL_KRETPROBE: - event_param->u.kretprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + case LTTNG_KERNEL_ABI_KRETPROBE: + event_param->u.kretprobe.symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; break; - case LTTNG_KERNEL_KPROBE: - event_param->u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + case LTTNG_KERNEL_ABI_KPROBE: + event_param->u.kprobe.symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; break; - case LTTNG_KERNEL_FUNCTION: + case LTTNG_KERNEL_ABI_FUNCTION: WARN_ON_ONCE(1); /* Not implemented. */ break; @@ -1817,8 +1817,8 @@ int lttng_abi_create_event(struct file *channel_file, goto event_error; switch (event_param->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: { struct lttng_event_enabler *event_enabler; @@ -1837,9 +1837,9 @@ int lttng_abi_create_event(struct file *channel_file, break; } - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: { struct lttng_event *event; @@ -1859,8 +1859,8 @@ int lttng_abi_create_event(struct file *channel_file, break; } - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: ret = -EINVAL; goto event_error; @@ -1887,7 +1887,7 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo enum lttng_event_type *evtype = file->private_data; switch (cmd) { - case LTTNG_KERNEL_ENABLE: + case LTTNG_KERNEL_ABI_ENABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: event_notifier = file->private_data; @@ -1899,7 +1899,7 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_DISABLE: + case LTTNG_KERNEL_ABI_DISABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: event_notifier = file->private_data; @@ -1911,7 +1911,7 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_FILTER: + case LTTNG_KERNEL_ABI_FILTER: switch (*evtype) { case LTTNG_TYPE_EVENT: return -EINVAL; @@ -1919,13 +1919,13 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_attach_filter_bytecode( event_notifier_enabler, - (struct lttng_kernel_filter_bytecode __user *) arg); + (struct lttng_kernel_abi_filter_bytecode __user *) arg); default: WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_CAPTURE: + case LTTNG_KERNEL_ABI_CAPTURE: switch (*evtype) { case LTTNG_TYPE_EVENT: return -EINVAL; @@ -1933,17 +1933,17 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_attach_capture_bytecode( event_notifier_enabler, - (struct lttng_kernel_capture_bytecode __user *) arg); + (struct lttng_kernel_abi_capture_bytecode __user *) arg); default: WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_ADD_CALLSITE: + case LTTNG_KERNEL_ABI_ADD_CALLSITE: switch (*evtype) { case LTTNG_TYPE_EVENT: event_notifier = file->private_data; return lttng_event_notifier_add_callsite(event_notifier, - (struct lttng_kernel_event_callsite __user *) arg); + (struct lttng_kernel_abi_event_callsite __user *) arg); case LTTNG_TYPE_ENABLER: return -EINVAL; default: @@ -1995,7 +1995,7 @@ static const struct file_operations lttng_event_notifier_fops = { static int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, - struct lttng_kernel_event_notifier *event_notifier_param) + struct lttng_kernel_abi_event_notifier *event_notifier_param) { struct lttng_event_notifier_group *event_notifier_group = event_notifier_group_file->private_data; @@ -2004,24 +2004,24 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, void *priv; switch (event_notifier_param->event.instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_TRACEPOINT: + case LTTNG_KERNEL_ABI_UPROBE: break; - case LTTNG_KERNEL_KPROBE: - event_notifier_param->event.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + case LTTNG_KERNEL_ABI_KPROBE: + event_notifier_param->event.u.kprobe.symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: /* Placing an event notifier on kretprobe is not supported. */ - case LTTNG_KERNEL_FUNCTION: - case LTTNG_KERNEL_NOOP: + case LTTNG_KERNEL_ABI_FUNCTION: + case LTTNG_KERNEL_ABI_NOOP: default: ret = -EINVAL; goto inval_instr; } - event_notifier_param->event.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + event_notifier_param->event.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; event_notifier_fd = lttng_get_unused_fd(); if (event_notifier_fd < 0) { @@ -2048,8 +2048,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, goto event_notifier_error; switch (event_notifier_param->event.instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: { struct lttng_event_notifier_enabler *enabler; @@ -2072,9 +2072,9 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, break; } - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: { struct lttng_event_notifier *event_notifier; @@ -2097,8 +2097,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, break; } - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: ret = -EINVAL; goto event_notifier_error; @@ -2121,7 +2121,7 @@ inval_instr: static long lttng_abi_event_notifier_group_create_error_counter( struct file *event_notifier_group_file, - const struct lttng_kernel_counter_conf *error_counter_conf) + const struct lttng_kernel_abi_counter_conf *error_counter_conf) { int counter_fd, ret; char *counter_transport_name; @@ -2131,7 +2131,7 @@ long lttng_abi_event_notifier_group_create_error_counter( struct lttng_event_notifier_group *event_notifier_group = (struct lttng_event_notifier_group *) event_notifier_group_file->private_data; - if (error_counter_conf->arithmetic != LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR) { + if (error_counter_conf->arithmetic != LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR) { printk(KERN_ERR "LTTng: event_notifier: Error counter of the wrong arithmetic type.\n"); return -EINVAL; } @@ -2142,10 +2142,10 @@ long lttng_abi_event_notifier_group_create_error_counter( } switch (error_counter_conf->bitness) { - case LTTNG_KERNEL_COUNTER_BITNESS_64: + case LTTNG_KERNEL_ABI_COUNTER_BITNESS_64: counter_transport_name = "counter-per-cpu-64-modular"; break; - case LTTNG_KERNEL_COUNTER_BITNESS_32: + case LTTNG_KERNEL_ABI_COUNTER_BITNESS_32: counter_transport_name = "counter-per-cpu-32-modular"; break; default: @@ -2228,26 +2228,26 @@ long lttng_event_notifier_group_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { switch (cmd) { - case LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD: + case LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD: { return lttng_abi_open_event_notifier_group_stream(file); } - case LTTNG_KERNEL_EVENT_NOTIFIER_CREATE: + case LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE: { - struct lttng_kernel_event_notifier uevent_notifier_param; + struct lttng_kernel_abi_event_notifier uevent_notifier_param; if (copy_from_user(&uevent_notifier_param, - (struct lttng_kernel_event_notifier __user *) arg, + (struct lttng_kernel_abi_event_notifier __user *) arg, sizeof(uevent_notifier_param))) return -EFAULT; return lttng_abi_create_event_notifier(file, &uevent_notifier_param); } - case LTTNG_KERNEL_COUNTER: + case LTTNG_KERNEL_ABI_COUNTER: { - struct lttng_kernel_counter_conf uerror_counter_conf; + struct lttng_kernel_abi_counter_conf uerror_counter_conf; if (copy_from_user(&uerror_counter_conf, - (struct lttng_kernel_counter_conf __user *) arg, + (struct lttng_kernel_abi_counter_conf __user *) arg, sizeof(uerror_counter_conf))) return -EFAULT; return lttng_abi_event_notifier_group_create_error_counter(file, @@ -2287,16 +2287,16 @@ static const struct file_operations lttng_event_notifier_group_fops = { * @arg: command arg * * This ioctl implements lttng commands: - * LTTNG_KERNEL_STREAM + * LTTNG_KERNEL_ABI_STREAM * Returns an event stream file descriptor or failure. * (typically, one event stream records events from one CPU) - * LTTNG_KERNEL_EVENT + * LTTNG_KERNEL_ABI_EVENT * Returns an event file descriptor or failure. - * LTTNG_KERNEL_CONTEXT + * LTTNG_KERNEL_ABI_CONTEXT * Prepend a context field to each event in the channel - * LTTNG_KERNEL_ENABLE + * LTTNG_KERNEL_ABI_ENABLE * Enable recording for events in this channel (weak enable) - * LTTNG_KERNEL_DISABLE + * LTTNG_KERNEL_ABI_DISABLE * Disable recording for events in this channel (strong disable) * * Channel and event file descriptors also hold a reference on the session. @@ -2307,31 +2307,31 @@ long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg) struct lttng_channel *channel = file->private_data; switch (cmd) { - case LTTNG_KERNEL_OLD_STREAM: - case LTTNG_KERNEL_STREAM: + case LTTNG_KERNEL_ABI_OLD_STREAM: + case LTTNG_KERNEL_ABI_STREAM: return lttng_abi_open_stream(file); - case LTTNG_KERNEL_OLD_EVENT: + case LTTNG_KERNEL_ABI_OLD_EVENT: { - struct lttng_kernel_event *uevent_param; - struct lttng_kernel_old_event *old_uevent_param; + struct lttng_kernel_abi_event *uevent_param; + struct lttng_kernel_abi_old_event *old_uevent_param; int ret; - uevent_param = kmalloc(sizeof(struct lttng_kernel_event), + uevent_param = kmalloc(sizeof(struct lttng_kernel_abi_event), GFP_KERNEL); if (!uevent_param) { ret = -ENOMEM; goto old_event_end; } old_uevent_param = kmalloc( - sizeof(struct lttng_kernel_old_event), + sizeof(struct lttng_kernel_abi_old_event), GFP_KERNEL); if (!old_uevent_param) { ret = -ENOMEM; goto old_event_error_free_param; } if (copy_from_user(old_uevent_param, - (struct lttng_kernel_old_event __user *) arg, - sizeof(struct lttng_kernel_old_event))) { + (struct lttng_kernel_abi_old_event __user *) arg, + sizeof(struct lttng_kernel_abi_old_event))) { ret = -EFAULT; goto old_event_error_free_old_param; } @@ -2342,7 +2342,7 @@ long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg) old_uevent_param->instrumentation; switch (old_uevent_param->instrumentation) { - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: uevent_param->u.kprobe.addr = old_uevent_param->u.kprobe.addr; uevent_param->u.kprobe.offset = @@ -2351,7 +2351,7 @@ long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg) old_uevent_param->u.kprobe.symbol_name, sizeof(uevent_param->u.kprobe.symbol_name)); break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: uevent_param->u.kretprobe.addr = old_uevent_param->u.kretprobe.addr; uevent_param->u.kretprobe.offset = @@ -2360,7 +2360,7 @@ long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg) old_uevent_param->u.kretprobe.symbol_name, sizeof(uevent_param->u.kretprobe.symbol_name)); break; - case LTTNG_KERNEL_FUNCTION: + case LTTNG_KERNEL_ABI_FUNCTION: WARN_ON_ONCE(1); /* Not implemented. */ break; @@ -2376,29 +2376,29 @@ old_event_error_free_param: old_event_end: return ret; } - case LTTNG_KERNEL_EVENT: + case LTTNG_KERNEL_ABI_EVENT: { - struct lttng_kernel_event uevent_param; + struct lttng_kernel_abi_event uevent_param; if (copy_from_user(&uevent_param, - (struct lttng_kernel_event __user *) arg, + (struct lttng_kernel_abi_event __user *) arg, sizeof(uevent_param))) return -EFAULT; return lttng_abi_create_event(file, &uevent_param); } - case LTTNG_KERNEL_OLD_CONTEXT: + case LTTNG_KERNEL_ABI_OLD_CONTEXT: { - struct lttng_kernel_context *ucontext_param; - struct lttng_kernel_old_context *old_ucontext_param; + struct lttng_kernel_abi_context *ucontext_param; + struct lttng_kernel_abi_old_context *old_ucontext_param; int ret; - ucontext_param = kmalloc(sizeof(struct lttng_kernel_context), + ucontext_param = kmalloc(sizeof(struct lttng_kernel_abi_context), GFP_KERNEL); if (!ucontext_param) { ret = -ENOMEM; goto old_ctx_end; } - old_ucontext_param = kmalloc(sizeof(struct lttng_kernel_old_context), + old_ucontext_param = kmalloc(sizeof(struct lttng_kernel_abi_old_context), GFP_KERNEL); if (!old_ucontext_param) { ret = -ENOMEM; @@ -2406,8 +2406,8 @@ old_event_end: } if (copy_from_user(old_ucontext_param, - (struct lttng_kernel_old_context __user *) arg, - sizeof(struct lttng_kernel_old_context))) { + (struct lttng_kernel_abi_old_context __user *) arg, + sizeof(struct lttng_kernel_abi_old_context))) { ret = -EFAULT; goto old_ctx_error_free_old_param; } @@ -2415,7 +2415,7 @@ old_event_end: memcpy(ucontext_param->padding, old_ucontext_param->padding, sizeof(ucontext_param->padding)); /* only type that uses the union */ - if (old_ucontext_param->ctx == LTTNG_KERNEL_CONTEXT_PERF_COUNTER) { + if (old_ucontext_param->ctx == LTTNG_KERNEL_ABI_CONTEXT_PERF_COUNTER) { ucontext_param->u.perf_counter.type = old_ucontext_param->u.perf_counter.type; ucontext_param->u.perf_counter.config = @@ -2436,27 +2436,27 @@ old_ctx_error_free_param: old_ctx_end: return ret; } - case LTTNG_KERNEL_CONTEXT: + case LTTNG_KERNEL_ABI_CONTEXT: { - struct lttng_kernel_context ucontext_param; + struct lttng_kernel_abi_context ucontext_param; if (copy_from_user(&ucontext_param, - (struct lttng_kernel_context __user *) arg, + (struct lttng_kernel_abi_context __user *) arg, sizeof(ucontext_param))) return -EFAULT; return lttng_abi_add_context(file, &ucontext_param, &channel->ctx, channel->session); } - case LTTNG_KERNEL_OLD_ENABLE: - case LTTNG_KERNEL_ENABLE: + case LTTNG_KERNEL_ABI_OLD_ENABLE: + case LTTNG_KERNEL_ABI_ENABLE: return lttng_channel_enable(channel); - case LTTNG_KERNEL_OLD_DISABLE: - case LTTNG_KERNEL_DISABLE: + case LTTNG_KERNEL_ABI_OLD_DISABLE: + case LTTNG_KERNEL_ABI_DISABLE: return lttng_channel_disable(channel); - case LTTNG_KERNEL_SYSCALL_MASK: + case LTTNG_KERNEL_ABI_SYSCALL_MASK: return lttng_channel_syscall_mask(channel, - (struct lttng_kernel_syscall_mask __user *) arg); + (struct lttng_kernel_abi_syscall_mask __user *) arg); default: return -ENOIOCTLCMD; } @@ -2470,7 +2470,7 @@ old_ctx_end: * @arg: command arg * * This ioctl implements lttng commands: - * LTTNG_KERNEL_STREAM + * LTTNG_KERNEL_ABI_STREAM * Returns an event stream file descriptor or failure. * * Channel and event file descriptors also hold a reference on the session. @@ -2479,8 +2479,8 @@ static long lttng_metadata_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { switch (cmd) { - case LTTNG_KERNEL_OLD_STREAM: - case LTTNG_KERNEL_STREAM: + case LTTNG_KERNEL_ABI_OLD_STREAM: + case LTTNG_KERNEL_ABI_STREAM: return lttng_abi_open_metadata_stream(file); default: return -ENOIOCTLCMD; @@ -2565,11 +2565,11 @@ static const struct file_operations lttng_metadata_fops = { * @arg: command arg * * This ioctl implements lttng commands: - * LTTNG_KERNEL_CONTEXT + * LTTNG_KERNEL_ABI_CONTEXT * Prepend a context field to each record of this event - * LTTNG_KERNEL_ENABLE + * LTTNG_KERNEL_ABI_ENABLE * Enable recording for this event (weak enable) - * LTTNG_KERNEL_DISABLE + * LTTNG_KERNEL_ABI_DISABLE * Disable recording for this event (strong disable) */ static @@ -2580,18 +2580,18 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg) enum lttng_event_type *evtype = file->private_data; switch (cmd) { - case LTTNG_KERNEL_OLD_CONTEXT: + case LTTNG_KERNEL_ABI_OLD_CONTEXT: { /* Not implemented */ return -ENOSYS; } - case LTTNG_KERNEL_CONTEXT: + case LTTNG_KERNEL_ABI_CONTEXT: { /* Not implemented */ return -ENOSYS; } - case LTTNG_KERNEL_OLD_ENABLE: - case LTTNG_KERNEL_ENABLE: + case LTTNG_KERNEL_ABI_OLD_ENABLE: + case LTTNG_KERNEL_ABI_ENABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: event = file->private_data; @@ -2603,8 +2603,8 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg) WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_OLD_DISABLE: - case LTTNG_KERNEL_DISABLE: + case LTTNG_KERNEL_ABI_OLD_DISABLE: + case LTTNG_KERNEL_ABI_DISABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: event = file->private_data; @@ -2616,7 +2616,7 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg) WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_FILTER: + case LTTNG_KERNEL_ABI_FILTER: switch (*evtype) { case LTTNG_TYPE_EVENT: return -EINVAL; @@ -2625,18 +2625,18 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg) event_enabler = file->private_data; return lttng_event_enabler_attach_filter_bytecode( event_enabler, - (struct lttng_kernel_filter_bytecode __user *) arg); + (struct lttng_kernel_abi_filter_bytecode __user *) arg); } default: WARN_ON_ONCE(1); return -ENOSYS; } - case LTTNG_KERNEL_ADD_CALLSITE: + case LTTNG_KERNEL_ABI_ADD_CALLSITE: switch (*evtype) { case LTTNG_TYPE_EVENT: event = file->private_data; return lttng_event_add_callsite(event, - (struct lttng_kernel_event_callsite __user *) arg); + (struct lttng_kernel_abi_event_callsite __user *) arg); case LTTNG_TYPE_ENABLER: return -EINVAL; default: @@ -2710,7 +2710,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, return -EIO; switch (cmd) { - case LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN: { uint64_t ts; @@ -2719,7 +2719,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_GET_TIMESTAMP_END: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END: { uint64_t ts; @@ -2728,7 +2728,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED: { uint64_t ed; @@ -2737,7 +2737,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ed, arg); } - case LTTNG_RING_BUFFER_GET_CONTENT_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE: { uint64_t cs; @@ -2746,7 +2746,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(cs, arg); } - case LTTNG_RING_BUFFER_GET_PACKET_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE: { uint64_t ps; @@ -2755,7 +2755,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ps, arg); } - case LTTNG_RING_BUFFER_GET_STREAM_ID: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID: { uint64_t si; @@ -2764,7 +2764,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(si, arg); } - case LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP: { uint64_t ts; @@ -2773,7 +2773,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_GET_SEQ_NUM: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM: { uint64_t seq; @@ -2782,7 +2782,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(seq, arg); } - case LTTNG_RING_BUFFER_INSTANCE_ID: + case LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID: { uint64_t id; @@ -2814,7 +2814,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, return -EIO; switch (cmd) { - case LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN: { uint64_t ts; @@ -2823,7 +2823,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_END: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_END: { uint64_t ts; @@ -2832,7 +2832,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED: { uint64_t ed; @@ -2841,7 +2841,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ed, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_CONTENT_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CONTENT_SIZE: { uint64_t cs; @@ -2850,7 +2850,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(cs, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_PACKET_SIZE: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PACKET_SIZE: { uint64_t ps; @@ -2859,7 +2859,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ps, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_STREAM_ID: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_STREAM_ID: { uint64_t si; @@ -2868,7 +2868,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(si, arg); } - case LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP: + case LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP: { uint64_t ts; @@ -2877,7 +2877,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } - case LTTNG_RING_BUFFER_COMPAT_GET_SEQ_NUM: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SEQ_NUM: { uint64_t seq; @@ -2886,7 +2886,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(seq, arg); } - case LTTNG_RING_BUFFER_COMPAT_INSTANCE_ID: + case LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_INSTANCE_ID: { uint64_t id; diff --git a/src/lttng-bytecode.c b/src/lttng-bytecode.c index 6ed20f7e..49ecd77a 100644 --- a/src/lttng-bytecode.c +++ b/src/lttng-bytecode.c @@ -227,7 +227,7 @@ int apply_field_reloc(const struct lttng_kernel_event_desc *event_desc, return -EINVAL; /* Check if field offset is too large for 16-bit offset */ - if (field_offset > LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN - 1) + if (field_offset > LTTNG_KERNEL_ABI_FILTER_BYTECODE_MAX_LEN - 1) return -EINVAL; /* set type */ @@ -310,7 +310,7 @@ int apply_context_reloc(struct bytecode_runtime *runtime, return -ENOENT; /* Check if idx is too large for 16-bit offset */ - if (idx > LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN - 1) + if (idx > LTTNG_KERNEL_ABI_FILTER_BYTECODE_MAX_LEN - 1) return -EINVAL; /* Get context return type */ diff --git a/src/lttng-calibrate.c b/src/lttng-calibrate.c index 38863194..56ee8cf8 100644 --- a/src/lttng-calibrate.c +++ b/src/lttng-calibrate.c @@ -16,10 +16,10 @@ void lttng_calibrate_kretprobe(void) asm volatile (""); } -int lttng_calibrate(struct lttng_kernel_calibrate *calibrate) +int lttng_calibrate(struct lttng_kernel_abi_calibrate *calibrate) { switch (calibrate->type) { - case LTTNG_KERNEL_CALIBRATE_KRETPROBE: + case LTTNG_KERNEL_ABI_CALIBRATE_KRETPROBE: lttng_calibrate_kretprobe(); break; default: diff --git a/src/lttng-context-callstack.c b/src/lttng-context-callstack.c index 82816875..3663168e 100644 --- a/src/lttng-context-callstack.c +++ b/src/lttng-context-callstack.c @@ -205,10 +205,10 @@ error_create: int lttng_add_callstack_to_ctx(struct lttng_kernel_ctx **ctx, int type) { switch (type) { - case LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL: + case LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL: return __lttng_add_callstack_generic(ctx, CALLSTACK_KERNEL); #ifdef CONFIG_X86 - case LTTNG_KERNEL_CONTEXT_CALLSTACK_USER: + case LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER: return __lttng_add_callstack_generic(ctx, CALLSTACK_USER); #endif default: diff --git a/src/lttng-event-notifier-notification.c b/src/lttng-event-notifier-notification.c index 1a40fed7..d10f0fda 100644 --- a/src/lttng-event-notifier-notification.c +++ b/src/lttng-event-notifier-notification.c @@ -382,7 +382,7 @@ void notification_send(struct lttng_event_notifier_notification *notif, { struct lttng_event_notifier_group *event_notifier_group = event_notifier->group; struct lib_ring_buffer_ctx ctx; - struct lttng_kernel_event_notifier_notification kernel_notif; + struct lttng_kernel_abi_event_notifier_notification kernel_notif; size_t capture_buffer_content_len, reserve_size; int ret; diff --git a/src/lttng-events.c b/src/lttng-events.c index 21653efd..e955b525 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -616,22 +616,22 @@ int lttng_event_enable(struct lttng_event *event) goto end; } switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: ret = -EINVAL; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: WRITE_ONCE(event->enabled, 1); break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: ret = lttng_kretprobes_event_enable_state(event, 1); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -655,23 +655,23 @@ int lttng_event_disable(struct lttng_event *event) goto end; } switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: ret = -EINVAL; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: WRITE_ONCE(event->enabled, 0); break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: ret = lttng_kretprobes_event_enable_state(event, 0); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -691,19 +691,19 @@ int lttng_event_notifier_enable(struct lttng_event_notifier *event_notifier) goto end; } switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: ret = -EINVAL; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: WRITE_ONCE(event_notifier->enabled, 1); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -723,19 +723,19 @@ int lttng_event_notifier_disable(struct lttng_event_notifier *event_notifier) goto end; } switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: ret = -EINVAL; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: WRITE_ONCE(event_notifier->enabled, 0); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -843,10 +843,10 @@ void _lttng_metadata_channel_hangup(struct lttng_metadata_stream *stream) * Needs to be called with sessions mutex held. */ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, void *filter, const struct lttng_kernel_event_desc *event_desc, - enum lttng_kernel_instrumentation itype) + enum lttng_kernel_abi_instrumentation itype) { struct lttng_session *session = chan->session; struct lttng_event *event; @@ -860,19 +860,19 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, } switch (itype) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: event_name = event_desc->event_name; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: event_name = event_param->name; break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -884,7 +884,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, lttng_hlist_for_each_entry(event, head, hlist) { WARN_ON_ONCE(!event->desc); if (!strncmp(event->desc->event_name, event_name, - LTTNG_KERNEL_SYM_NAME_LEN - 1) + LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1) && chan == event->chan) { ret = -EEXIST; goto exist; @@ -905,7 +905,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, INIT_LIST_HEAD(&event->enablers_ref_head); switch (itype) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Event will be enabled by enabler sync. */ event->enabled = 0; event->registered = 0; @@ -918,7 +918,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, smp_wmb(); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -943,7 +943,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, WARN_ON_ONCE(!ret); break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: { struct lttng_event *event_return; @@ -1000,7 +1000,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, break; } - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -1009,24 +1009,24 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, event->registered = 0; event->desc = event_desc; switch (event_param->u.syscall.entryexit) { - case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: ret = -EINVAL; goto register_error; - case LTTNG_KERNEL_SYSCALL_ENTRY: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: event->u.syscall.entryexit = LTTNG_SYSCALL_ENTRY; break; - case LTTNG_KERNEL_SYSCALL_EXIT: + case LTTNG_KERNEL_ABI_SYSCALL_EXIT: event->u.syscall.entryexit = LTTNG_SYSCALL_EXIT; break; } switch (event_param->u.syscall.abi) { - case LTTNG_KERNEL_SYSCALL_ABI_ALL: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL: ret = -EINVAL; goto register_error; - case LTTNG_KERNEL_SYSCALL_ABI_NATIVE: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE: event->u.syscall.abi = LTTNG_SYSCALL_ABI_NATIVE; break; - case LTTNG_KERNEL_SYSCALL_ABI_COMPAT: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT: event->u.syscall.abi = LTTNG_SYSCALL_ABI_COMPAT; break; } @@ -1036,7 +1036,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, } break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -1059,8 +1059,8 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan, WARN_ON_ONCE(!ret); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -1090,8 +1090,8 @@ struct lttng_event_notifier *_lttng_event_notifier_create( const struct lttng_kernel_event_desc *event_desc, uint64_t token, uint64_t error_counter_index, struct lttng_event_notifier_group *event_notifier_group, - struct lttng_kernel_event_notifier *event_notifier_param, - void *filter, enum lttng_kernel_instrumentation itype) + struct lttng_kernel_abi_event_notifier *event_notifier_param, + void *filter, enum lttng_kernel_abi_instrumentation itype) { struct lttng_event_notifier *event_notifier; struct lttng_counter *error_counter; @@ -1100,19 +1100,19 @@ struct lttng_event_notifier *_lttng_event_notifier_create( int ret; switch (itype) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: event_name = event_desc->event_name; break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: event_name = event_notifier_param->event.name; break; - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -1124,7 +1124,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create( lttng_hlist_for_each_entry(event_notifier, head, hlist) { WARN_ON_ONCE(!event_notifier->desc); if (!strncmp(event_notifier->desc->event_name, event_name, - LTTNG_KERNEL_SYM_NAME_LEN - 1) + LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1) && event_notifier_group == event_notifier->group && token == event_notifier->user_token) { ret = -EEXIST; @@ -1151,7 +1151,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create( INIT_LIST_HEAD(&event_notifier->enablers_ref_head); switch (itype) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Event will be enabled by enabler sync. */ event_notifier->enabled = 0; event_notifier->registered = 0; @@ -1164,7 +1164,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create( smp_wmb(); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -1189,7 +1189,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create( WARN_ON_ONCE(!ret); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -1198,24 +1198,24 @@ struct lttng_event_notifier *_lttng_event_notifier_create( event_notifier->registered = 0; event_notifier->desc = event_desc; switch (event_notifier_param->event.u.syscall.entryexit) { - case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: ret = -EINVAL; goto register_error; - case LTTNG_KERNEL_SYSCALL_ENTRY: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: event_notifier->u.syscall.entryexit = LTTNG_SYSCALL_ENTRY; break; - case LTTNG_KERNEL_SYSCALL_EXIT: + case LTTNG_KERNEL_ABI_SYSCALL_EXIT: event_notifier->u.syscall.entryexit = LTTNG_SYSCALL_EXIT; break; } switch (event_notifier_param->event.u.syscall.abi) { - case LTTNG_KERNEL_SYSCALL_ABI_ALL: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL: ret = -EINVAL; goto register_error; - case LTTNG_KERNEL_SYSCALL_ABI_NATIVE: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE: event_notifier->u.syscall.abi = LTTNG_SYSCALL_ABI_NATIVE; break; - case LTTNG_KERNEL_SYSCALL_ABI_COMPAT: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT: event_notifier->u.syscall.abi = LTTNG_SYSCALL_ABI_COMPAT; break; } @@ -1226,7 +1226,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create( } break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: /* * Needs to be explicitly enabled after creation, since * we may want to apply filters. @@ -1250,9 +1250,9 @@ struct lttng_event_notifier *_lttng_event_notifier_create( WARN_ON_ONCE(!ret); break; - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); ret = -EINVAL; @@ -1324,10 +1324,10 @@ int lttng_kernel_counter_clear(struct lttng_counter *counter, } struct lttng_event *lttng_event_create(struct lttng_channel *chan, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, void *filter, const struct lttng_kernel_event_desc *event_desc, - enum lttng_kernel_instrumentation itype) + enum lttng_kernel_abi_instrumentation itype) { struct lttng_event *event; @@ -1342,8 +1342,8 @@ struct lttng_event_notifier *lttng_event_notifier_create( const struct lttng_kernel_event_desc *event_desc, uint64_t id, uint64_t error_counter_index, struct lttng_event_notifier_group *event_notifier_group, - struct lttng_kernel_event_notifier *event_notifier_param, - void *filter, enum lttng_kernel_instrumentation itype) + struct lttng_kernel_abi_event_notifier *event_notifier_param, + void *filter, enum lttng_kernel_abi_instrumentation itype) { struct lttng_event_notifier *event_notifier; @@ -1367,24 +1367,24 @@ void register_event(struct lttng_event *event) desc = event->desc; switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: ret = lttng_wrapper_tracepoint_probe_register(desc->event_kname, desc->probe_callback, event); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: ret = lttng_syscall_filter_enable_event(event->chan, event); break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: /* Fall-through */ - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: ret = 0; break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1405,36 +1405,36 @@ int _lttng_event_unregister(struct lttng_event *event) desc = event->desc; switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: ret = lttng_wrapper_tracepoint_probe_unregister(event->desc->event_kname, event->desc->probe_callback, event); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: lttng_kprobes_unregister_event(event); ret = 0; break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: lttng_kretprobes_unregister(event); ret = 0; break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: ret = lttng_syscall_filter_disable_event(event->chan, event); break; - case LTTNG_KERNEL_NOOP: + case LTTNG_KERNEL_ABI_NOOP: ret = 0; break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: lttng_uprobes_unregister_event(event); ret = 0; break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1455,24 +1455,24 @@ void register_event_notifier(struct lttng_event_notifier *event_notifier) desc = event_notifier->desc; switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: ret = lttng_wrapper_tracepoint_probe_register(desc->event_kname, desc->event_notifier_callback, event_notifier); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: ret = lttng_syscall_filter_enable_event_notifier(event_notifier); break; - case LTTNG_KERNEL_KPROBE: /* Fall-through */ - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_UPROBE: ret = 0; break; - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1492,29 +1492,29 @@ int _lttng_event_notifier_unregister( desc = event_notifier->desc; switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: ret = lttng_wrapper_tracepoint_probe_unregister(event_notifier->desc->event_kname, event_notifier->desc->event_notifier_callback, event_notifier); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: lttng_kprobes_unregister_event_notifier(event_notifier); ret = 0; break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: lttng_uprobes_unregister_event_notifier(event_notifier); ret = 0; break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: ret = lttng_syscall_filter_disable_event_notifier(event_notifier); break; - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1532,30 +1532,30 @@ void _lttng_event_destroy(struct lttng_event *event) struct lttng_enabler_ref *enabler_ref, *tmp_enabler_ref; switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: lttng_event_desc_put(event->desc); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: module_put(event->desc->owner); lttng_kprobes_destroy_event_private(event); break; - case LTTNG_KERNEL_KRETPROBE: + case LTTNG_KERNEL_ABI_KRETPROBE: module_put(event->desc->owner); lttng_kretprobes_destroy_private(event); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: module_put(event->desc->owner); lttng_uprobes_destroy_event_private(event); break; - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1578,26 +1578,26 @@ void _lttng_event_notifier_destroy(struct lttng_event_notifier *event_notifier) struct lttng_enabler_ref *enabler_ref, *tmp_enabler_ref; switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: lttng_event_desc_put(event_notifier->desc); break; - case LTTNG_KERNEL_KPROBE: + case LTTNG_KERNEL_ABI_KPROBE: module_put(event_notifier->desc->owner); lttng_kprobes_destroy_event_notifier_private(event_notifier); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: break; - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: module_put(event_notifier->desc->owner); lttng_uprobes_destroy_event_notifier_private(event_notifier); break; - case LTTNG_KERNEL_KRETPROBE: /* Fall-through */ - case LTTNG_KERNEL_FUNCTION: /* Fall-through */ - case LTTNG_KERNEL_NOOP: /* Fall-through */ + case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */ + case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */ + case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */ default: WARN_ON_ONCE(1); } @@ -1893,7 +1893,7 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, enabler_name = enabler->event_param.name; switch (enabler->event_param.instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: desc_name = desc->event_name; switch (enabler->format_type) { case LTTNG_ENABLER_FORMAT_STAR_GLOB: @@ -1905,7 +1905,7 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, } break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: desc_name = desc->event_name; if (!strncmp(desc_name, "compat_", strlen("compat_"))) { desc_name += strlen("compat_"); @@ -1923,13 +1923,13 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, return -EINVAL; } switch (enabler->event_param.u.syscall.entryexit) { - case LTTNG_KERNEL_SYSCALL_ENTRYEXIT: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT: break; - case LTTNG_KERNEL_SYSCALL_ENTRY: + case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: if (!entry) return 0; break; - case LTTNG_KERNEL_SYSCALL_EXIT: + case LTTNG_KERNEL_ABI_SYSCALL_EXIT: if (entry) return 0; break; @@ -1937,13 +1937,13 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, return -EINVAL; } switch (enabler->event_param.u.syscall.abi) { - case LTTNG_KERNEL_SYSCALL_ABI_ALL: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL: break; - case LTTNG_KERNEL_SYSCALL_ABI_NATIVE: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE: if (compat) return 0; break; - case LTTNG_KERNEL_SYSCALL_ABI_COMPAT: + case LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT: if (!compat) return 0; break; @@ -1951,7 +1951,7 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, return -EINVAL; } switch (enabler->event_param.u.syscall.match) { - case LTTNG_KERNEL_SYSCALL_MATCH_NAME: + case LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME: switch (enabler->format_type) { case LTTNG_ENABLER_FORMAT_STAR_GLOB: return lttng_match_enabler_star_glob(desc_name, enabler_name); @@ -1961,7 +1961,7 @@ int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc, return -EINVAL; } break; - case LTTNG_KERNEL_SYSCALL_MATCH_NR: + case LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR: return -EINVAL; /* Not implemented. */ default: return -EINVAL; @@ -2067,7 +2067,7 @@ void lttng_create_tracepoint_event_if_missing(struct lttng_event_enabler *event_ */ event = _lttng_event_create(event_enabler->chan, NULL, NULL, desc, - LTTNG_KERNEL_TRACEPOINT); + LTTNG_KERNEL_ABI_TRACEPOINT); if (!event) { printk(KERN_INFO "LTTng: Unable to create event %s\n", probe_desc->event_desc[i]->event_name); @@ -2123,7 +2123,7 @@ void lttng_create_tracepoint_event_notifier_if_missing(struct lttng_event_notifi event_notifier_enabler->base.user_token, event_notifier_enabler->error_counter_index, event_notifier_group, NULL, NULL, - LTTNG_KERNEL_TRACEPOINT); + LTTNG_KERNEL_ABI_TRACEPOINT); if (IS_ERR(event_notifier)) { printk(KERN_INFO "Unable to create event_notifier %s\n", probe_desc->event_desc[i]->event_name); @@ -2161,11 +2161,11 @@ static void lttng_create_event_if_missing(struct lttng_event_enabler *event_enabler) { switch (event_enabler->base.event_param.instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: lttng_create_tracepoint_event_if_missing(event_enabler); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: lttng_create_syscall_event_if_missing(event_enabler); break; @@ -2188,17 +2188,17 @@ int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler) struct lttng_enabler *base_enabler = lttng_event_enabler_as_enabler(event_enabler); struct lttng_event *event; - if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_SYSCALL && - base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_SYSCALL_ABI_ALL && - base_enabler->event_param.u.syscall.match == LTTNG_KERNEL_SYSCALL_MATCH_NAME && + if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_ABI_SYSCALL && + base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL && + base_enabler->event_param.u.syscall.match == LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME && !strcmp(base_enabler->event_param.name, "*")) { int enabled = base_enabler->enabled; - enum lttng_kernel_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit; + enum lttng_kernel_abi_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit; - if (entryexit == LTTNG_KERNEL_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) WRITE_ONCE(chan->syscall_all_entry, enabled); - if (entryexit == LTTNG_KERNEL_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) WRITE_ONCE(chan->syscall_all_exit, enabled); } @@ -2248,11 +2248,11 @@ static void lttng_create_event_notifier_if_missing(struct lttng_event_notifier_enabler *event_notifier_enabler) { switch (event_notifier_enabler->base.event_param.instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: + case LTTNG_KERNEL_ABI_TRACEPOINT: lttng_create_tracepoint_event_notifier_if_missing(event_notifier_enabler); break; - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_SYSCALL: lttng_create_syscall_event_notifier_if_missing(event_notifier_enabler); break; @@ -2273,18 +2273,18 @@ int lttng_event_notifier_enabler_ref_event_notifiers( struct lttng_enabler *base_enabler = lttng_event_notifier_enabler_as_enabler(event_notifier_enabler); struct lttng_event_notifier *event_notifier; - if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_SYSCALL && - base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_SYSCALL_ABI_ALL && - base_enabler->event_param.u.syscall.match == LTTNG_KERNEL_SYSCALL_MATCH_NAME && + if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_ABI_SYSCALL && + base_enabler->event_param.u.syscall.abi == LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL && + base_enabler->event_param.u.syscall.match == LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME && !strcmp(base_enabler->event_param.name, "*")) { int enabled = base_enabler->enabled; - enum lttng_kernel_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit; + enum lttng_kernel_abi_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit; - if (entryexit == LTTNG_KERNEL_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) WRITE_ONCE(event_notifier_group->syscall_all_entry, enabled); - if (entryexit == LTTNG_KERNEL_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) WRITE_ONCE(event_notifier_group->syscall_all_exit, enabled); } @@ -2382,7 +2382,7 @@ int lttng_fix_pending_event_notifiers(void) struct lttng_event_enabler *lttng_event_enabler_create( enum lttng_enabler_format_type format_type, - struct lttng_kernel_event *event_param, + struct lttng_kernel_abi_event *event_param, struct lttng_channel *chan) { struct lttng_event_enabler *event_enabler; @@ -2425,7 +2425,7 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler) static int lttng_enabler_attach_filter_bytecode(struct lttng_enabler *enabler, - struct lttng_kernel_filter_bytecode __user *bytecode) + struct lttng_kernel_abi_filter_bytecode __user *bytecode) { struct lttng_bytecode_node *bytecode_node; uint32_t bytecode_len; @@ -2457,7 +2457,7 @@ error_free: } int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler, - struct lttng_kernel_filter_bytecode __user *bytecode) + struct lttng_kernel_abi_filter_bytecode __user *bytecode) { int ret; ret = lttng_enabler_attach_filter_bytecode( @@ -2473,23 +2473,17 @@ error: } int lttng_event_add_callsite(struct lttng_event *event, - struct lttng_kernel_event_callsite __user *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { switch (event->instrumentation) { - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: return lttng_uprobes_event_add_callsite(event, callsite); default: return -EINVAL; } } -int lttng_event_enabler_attach_context(struct lttng_event_enabler *event_enabler, - struct lttng_kernel_context *context_param) -{ - return -ENOSYS; -} - static void lttng_enabler_destroy(struct lttng_enabler *enabler) { @@ -2517,7 +2511,7 @@ void lttng_event_enabler_destroy(struct lttng_event_enabler *event_enabler) struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( struct lttng_event_notifier_group *event_notifier_group, enum lttng_enabler_format_type format_type, - struct lttng_kernel_event_notifier *event_notifier_param) + struct lttng_kernel_abi_event_notifier *event_notifier_param) { struct lttng_event_notifier_enabler *event_notifier_enabler; @@ -2571,7 +2565,7 @@ int lttng_event_notifier_enabler_disable( int lttng_event_notifier_enabler_attach_filter_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_kernel_filter_bytecode __user *bytecode) + struct lttng_kernel_abi_filter_bytecode __user *bytecode) { int ret; @@ -2590,7 +2584,7 @@ error: int lttng_event_notifier_enabler_attach_capture_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_kernel_capture_bytecode __user *bytecode) + struct lttng_kernel_abi_capture_bytecode __user *bytecode) { struct lttng_bytecode_node *bytecode_node; struct lttng_enabler *enabler = @@ -2631,11 +2625,11 @@ end: } int lttng_event_notifier_add_callsite(struct lttng_event_notifier *event_notifier, - struct lttng_kernel_event_callsite __user *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_UPROBE: + case LTTNG_KERNEL_ABI_UPROBE: return lttng_uprobes_event_notifier_add_callsite(event_notifier, callsite); default: @@ -2643,13 +2637,6 @@ int lttng_event_notifier_add_callsite(struct lttng_event_notifier *event_notifie } } -int lttng_event_notifier_enabler_attach_context( - struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_kernel_context *context_param) -{ - return -ENOSYS; -} - static void lttng_event_notifier_enabler_destroy( struct lttng_event_notifier_enabler *event_notifier_enabler) @@ -2688,8 +2675,8 @@ void lttng_session_sync_event_enablers(struct lttng_session *session) int enabled = 0, has_enablers_without_bytecode = 0; switch (event->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: /* Enable events */ list_for_each_entry(enabler_ref, &event->enablers_ref_head, node) { @@ -2776,8 +2763,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group int enabled = 0, has_enablers_without_bytecode = 0; switch (event_notifier->instrumentation) { - case LTTNG_KERNEL_TRACEPOINT: /* Fall-through */ - case LTTNG_KERNEL_SYSCALL: + case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */ + case LTTNG_KERNEL_ABI_SYSCALL: /* Enable event_notifiers */ list_for_each_entry(enabler_ref, &event_notifier->enablers_ref_head, node) { diff --git a/src/lttng-probes.c b/src/lttng-probes.c index a320b628..aba7ada5 100644 --- a/src/lttng-probes.c +++ b/src/lttng-probes.c @@ -45,7 +45,7 @@ int check_event_provider(struct lttng_kernel_probe_desc *desc) size_t provider_name_len; provider_name_len = strnlen(desc->provider_name, - LTTNG_KERNEL_SYM_NAME_LEN - 1); + LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1); for (i = 0; i < desc->nr_events; i++) { if (strncmp(desc->event_desc[i]->event_name, desc->provider_name, diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index de84a18b..6f95fe93 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -1112,7 +1112,7 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl /* Allocate events for each syscall matching enabler, insert into table */ for (i = 0; i < table_len; i++) { const struct lttng_kernel_event_desc *desc = table[i].desc; - struct lttng_kernel_event ev; + struct lttng_kernel_abi_event ev; struct lttng_event *event; struct hlist_head *head; bool found = false; @@ -1142,25 +1142,25 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl memset(&ev, 0, sizeof(ev)); switch (type) { case SC_TYPE_ENTRY: - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_EXIT: - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_COMPAT_ENTRY: - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; case SC_TYPE_COMPAT_EXIT: - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; } - strncpy(ev.name, desc->event_name, LTTNG_KERNEL_SYM_NAME_LEN - 1); - ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - ev.instrumentation = LTTNG_KERNEL_SYSCALL; + strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1); + ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; event = _lttng_event_create(chan, &ev, filter, desc, ev.instrumentation); WARN_ON_ONCE(!event); @@ -1184,7 +1184,7 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler, void *filter) { struct lttng_channel *chan = event_enabler->chan; - struct lttng_kernel_event ev; + struct lttng_kernel_abi_event ev; int ret; wrapper_vmalloc_sync_mappings(); @@ -1228,11 +1228,11 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler, voi struct lttng_event *event; memset(&ev, 0, sizeof(ev)); - strncpy(ev.name, desc->event_name, LTTNG_KERNEL_SYM_NAME_LEN); - ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - ev.instrumentation = LTTNG_KERNEL_SYSCALL; - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN); + ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; event = _lttng_event_create(chan, &ev, filter, desc, ev.instrumentation); WARN_ON_ONCE(!event); @@ -1248,11 +1248,11 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler, voi struct lttng_event *event; memset(&ev, 0, sizeof(ev)); - strncpy(ev.name, desc->event_name, LTTNG_KERNEL_SYM_NAME_LEN); - ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - ev.instrumentation = LTTNG_KERNEL_SYSCALL; - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN); + ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; event = _lttng_event_create(chan, &ev, filter, desc, ev.instrumentation); WARN_ON_ONCE(!event); @@ -1268,11 +1268,11 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler, voi struct lttng_event *event; memset(&ev, 0, sizeof(ev)); - strncpy(ev.name, desc->event_name, LTTNG_KERNEL_SYM_NAME_LEN); - ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - ev.instrumentation = LTTNG_KERNEL_SYSCALL; - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN); + ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; event = _lttng_event_create(chan, &ev, filter, desc, ev.instrumentation); WARN_ON_ONCE(!event); @@ -1288,11 +1288,11 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler, voi struct lttng_event *event; memset(&ev, 0, sizeof(ev)); - strncpy(ev.name, desc->event_name, LTTNG_KERNEL_SYM_NAME_LEN); - ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - ev.instrumentation = LTTNG_KERNEL_SYSCALL; - ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN); + ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; + ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; event = _lttng_event_create(chan, &ev, filter, desc, ev.instrumentation); WARN_ON_ONCE(!event); @@ -1467,7 +1467,7 @@ int create_unknown_event_notifier( struct lttng_event_notifier *notifier; const struct lttng_kernel_event_desc *desc; struct lttng_event_notifier_group *group = event_notifier_enabler->group; - struct lttng_kernel_event_notifier event_notifier_param; + struct lttng_kernel_abi_event_notifier event_notifier_param; uint64_t user_token = event_notifier_enabler->base.user_token; uint64_t error_counter_index = event_notifier_enabler->error_counter_index; struct lttng_enabler *base_enabler = lttng_event_notifier_enabler_as_enabler( @@ -1475,34 +1475,34 @@ int create_unknown_event_notifier( struct hlist_head *unknown_dispatch_list; int ret = 0; bool found = false; - enum lttng_kernel_syscall_abi abi; - enum lttng_kernel_syscall_entryexit entryexit; + enum lttng_kernel_abi_syscall_abi abi; + enum lttng_kernel_abi_syscall_entryexit entryexit; struct hlist_head *head; switch (type) { case SC_TYPE_ENTRY: desc = &__event_desc___syscall_entry_unknown; unknown_dispatch_list = &group->event_notifier_unknown_syscall_dispatch; - entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_EXIT: desc = &__event_desc___syscall_exit_unknown; unknown_dispatch_list = &group->event_notifier_exit_unknown_syscall_dispatch; - entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_COMPAT_ENTRY: desc = &__event_desc___compat_syscall_entry_unknown; unknown_dispatch_list = &group->event_notifier_compat_unknown_syscall_dispatch; - entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; case SC_TYPE_COMPAT_EXIT: desc = &__event_desc___compat_syscall_exit_unknown; unknown_dispatch_list = &group->event_notifier_exit_compat_unknown_syscall_dispatch; - entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; default: BUG_ON(1); @@ -1523,11 +1523,11 @@ int create_unknown_event_notifier( memset(&event_notifier_param, 0, sizeof(event_notifier_param)); strncat(event_notifier_param.event.name, desc->event_name, - LTTNG_KERNEL_SYM_NAME_LEN - strlen(event_notifier_param.event.name) - 1); + LTTNG_KERNEL_ABI_SYM_NAME_LEN - strlen(event_notifier_param.event.name) - 1); - event_notifier_param.event.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + event_notifier_param.event.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; - event_notifier_param.event.instrumentation = LTTNG_KERNEL_SYSCALL; + event_notifier_param.event.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; event_notifier_param.event.u.syscall.abi = abi; event_notifier_param.event.u.syscall.entryexit = entryexit; @@ -1562,7 +1562,7 @@ static int create_matching_event_notifiers( /* iterate over all syscall and create event_notifier that match */ for (i = 0; i < table_len; i++) { struct lttng_event_notifier *event_notifier; - struct lttng_kernel_event_notifier event_notifier_param; + struct lttng_kernel_abi_event_notifier event_notifier_param; struct hlist_head *head; int found = 0; @@ -1592,26 +1592,26 @@ static int create_matching_event_notifiers( memset(&event_notifier_param, 0, sizeof(event_notifier_param)); switch (type) { case SC_TYPE_ENTRY: - event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_EXIT: - event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE; + event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE; break; case SC_TYPE_COMPAT_ENTRY: - event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY; - event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY; + event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; case SC_TYPE_COMPAT_EXIT: - event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT; - event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT; + event_notifier_param.event.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT; + event_notifier_param.event.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT; break; } strncat(event_notifier_param.event.name, desc->event_name, - LTTNG_KERNEL_SYM_NAME_LEN - strlen(event_notifier_param.event.name) - 1); - event_notifier_param.event.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; - event_notifier_param.event.instrumentation = LTTNG_KERNEL_SYSCALL; + LTTNG_KERNEL_ABI_SYM_NAME_LEN - strlen(event_notifier_param.event.name) - 1); + event_notifier_param.event.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0'; + event_notifier_param.event.instrumentation = LTTNG_KERNEL_ABI_SYSCALL; event_notifier = _lttng_event_notifier_create(desc, user_token, error_counter_index, group, &event_notifier_param, @@ -1638,10 +1638,10 @@ int lttng_syscals_create_matching_event_notifiers( int ret; struct lttng_enabler *base_enabler = lttng_event_notifier_enabler_as_enabler(event_notifier_enabler); - enum lttng_kernel_syscall_entryexit entryexit = + enum lttng_kernel_abi_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit; - if (entryexit == LTTNG_KERNEL_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) { + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) { ret = create_matching_event_notifiers(event_notifier_enabler, filter, sc_table, ARRAY_SIZE(sc_table), SC_TYPE_ENTRY); if (ret) @@ -1664,7 +1664,7 @@ int lttng_syscals_create_matching_event_notifiers( goto end; } - if (entryexit == LTTNG_KERNEL_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT) { + if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) { ret = create_matching_event_notifiers(event_notifier_enabler, filter, sc_exit_table, ARRAY_SIZE(sc_exit_table), SC_TYPE_EXIT); @@ -1917,7 +1917,7 @@ int lttng_syscall_filter_enable_event_notifier( struct hlist_head *dispatch_list; int ret = 0; - WARN_ON_ONCE(notifier->instrumentation != LTTNG_KERNEL_SYSCALL); + WARN_ON_ONCE(notifier->instrumentation != LTTNG_KERNEL_ABI_SYSCALL); ret = lttng_syscall_filter_enable(group->sc_filter, notifier->desc->event_name, notifier->u.syscall.abi, @@ -1968,7 +1968,7 @@ int lttng_syscall_filter_enable_event( struct lttng_channel *channel, struct lttng_event *event) { - WARN_ON_ONCE(event->instrumentation != LTTNG_KERNEL_SYSCALL); + WARN_ON_ONCE(event->instrumentation != LTTNG_KERNEL_ABI_SYSCALL); return lttng_syscall_filter_enable(channel->sc_filter, event->desc->event_name, event->u.syscall.abi, @@ -2041,7 +2041,7 @@ int lttng_syscall_filter_disable_event_notifier( struct lttng_event_notifier_group *group = notifier->group; int ret; - WARN_ON_ONCE(notifier->instrumentation != LTTNG_KERNEL_SYSCALL); + WARN_ON_ONCE(notifier->instrumentation != LTTNG_KERNEL_ABI_SYSCALL); ret = lttng_syscall_filter_disable(group->sc_filter, notifier->desc->event_name, notifier->u.syscall.abi, @@ -2176,7 +2176,7 @@ const struct file_operations lttng_syscall_list_fops = { * A syscall is enabled if it is traced for either entry or exit. */ long lttng_channel_syscall_mask(struct lttng_channel *channel, - struct lttng_kernel_syscall_mask __user *usyscall_mask) + struct lttng_kernel_abi_syscall_mask __user *usyscall_mask) { uint32_t len, sc_tables_len, bitmask_len; int ret = 0, bit; diff --git a/src/probes/lttng-kprobes.c b/src/probes/lttng-kprobes.c index 6e8cb20f..5d22169d 100644 --- a/src/probes/lttng-kprobes.c +++ b/src/probes/lttng-kprobes.c @@ -163,14 +163,14 @@ int _lttng_kprobes_register(const char *symbol_name, if (symbol_name) { lttng_kp->symbol_name = - kzalloc(LTTNG_KERNEL_SYM_NAME_LEN * sizeof(char), + kzalloc(LTTNG_KERNEL_ABI_SYM_NAME_LEN * sizeof(char), GFP_KERNEL); if (!lttng_kp->symbol_name) { ret = -ENOMEM; goto name_error; } memcpy(lttng_kp->symbol_name, symbol_name, - LTTNG_KERNEL_SYM_NAME_LEN * sizeof(char)); + LTTNG_KERNEL_ABI_SYM_NAME_LEN * sizeof(char)); lttng_kp->kp.symbol_name = lttng_kp->symbol_name; } diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c index 6b794eb8..79add986 100644 --- a/src/probes/lttng-kretprobes.c +++ b/src/probes/lttng-kretprobes.c @@ -299,7 +299,7 @@ int lttng_kretprobes_event_enable_state(struct lttng_event *event, struct lttng_event *event_exit; struct lttng_krp *lttng_krp; - if (event->instrumentation != LTTNG_KERNEL_KRETPROBE) { + if (event->instrumentation != LTTNG_KERNEL_ABI_KRETPROBE) { return -EINVAL; } if (event->enabled == enable) { diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index 89b474d1..74616203 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -194,7 +194,7 @@ error: static int lttng_uprobes_add_callsite(struct lttng_uprobe *uprobe, - struct lttng_kernel_event_callsite __user *callsite, + struct lttng_kernel_abi_event_callsite __user *callsite, int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs), void *priv_data) { @@ -245,7 +245,7 @@ end: } int lttng_uprobes_event_add_callsite(struct lttng_event *event, - struct lttng_kernel_event_callsite __user *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { return lttng_uprobes_add_callsite(&event->u.uprobe, callsite, lttng_uprobes_event_handler_pre, event); @@ -253,7 +253,7 @@ int lttng_uprobes_event_add_callsite(struct lttng_event *event, EXPORT_SYMBOL_GPL(lttng_uprobes_event_add_callsite); int lttng_uprobes_event_notifier_add_callsite(struct lttng_event_notifier *event_notifier, - struct lttng_kernel_event_callsite __user *callsite) + struct lttng_kernel_abi_event_callsite __user *callsite) { return lttng_uprobes_add_callsite(&event_notifier->u.uprobe, callsite, lttng_uprobes_event_notifier_handler_pre, event_notifier); -- 2.34.1