attr->u.kprobe.addr = ev->attr.probe.addr;
attr->u.kprobe.offset = ev->attr.probe.offset;
strncpy(attr->u.kprobe.symbol_name,
- ev->attr.probe.symbol_name, LTTNG_SYM_NAME_LEN);
- attr->u.kprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+ ev->attr.probe.symbol_name, LTTNG_KERNEL_SYM_NAME_LEN);
+ attr->u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
break;
case LTTNG_EVENT_FUNCTION:
attr->instrumentation = LTTNG_KERNEL_KRETPROBE;
attr->u.kretprobe.offset = ev->attr.probe.offset;
attr->u.kretprobe.offset = ev->attr.probe.offset;
strncpy(attr->u.kretprobe.symbol_name,
- ev->attr.probe.symbol_name, LTTNG_SYM_NAME_LEN);
- attr->u.kretprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+ ev->attr.probe.symbol_name, LTTNG_KERNEL_SYM_NAME_LEN);
+ attr->u.kretprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
break;
case LTTNG_EVENT_FUNCTION_ENTRY:
attr->instrumentation = LTTNG_KERNEL_FUNCTION;
strncpy(attr->u.ftrace.symbol_name,
- ev->attr.ftrace.symbol_name, LTTNG_SYM_NAME_LEN);
- attr->u.ftrace.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+ ev->attr.ftrace.symbol_name, LTTNG_KERNEL_SYM_NAME_LEN);
+ attr->u.ftrace.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
break;
case LTTNG_EVENT_TRACEPOINT:
attr->instrumentation = LTTNG_KERNEL_TRACEPOINT;
}
/* Copy event name */
- strncpy(attr->name, ev->name, LTTNG_SYM_NAME_LEN);
- attr->name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+ strncpy(attr->name, ev->name, LTTNG_KERNEL_SYM_NAME_LEN);
+ attr->name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
/* Setting up a kernel event */
lke->fd = 0;
#include <stdint.h>
-#define LTTNG_SYM_NAME_LEN 256
+#define LTTNG_KERNEL_SYM_NAME_LEN 256
/*
* LTTng DebugFS ABI structures.
struct lttng_kernel_perf_counter_ctx {
uint32_t type;
uint64_t config;
- char name[LTTNG_SYM_NAME_LEN];
+ char name[LTTNG_KERNEL_SYM_NAME_LEN];
};
/* Event/Channel context */
+#define LTTNG_KERNEL_CONTEXT_PADDING1 16
+#define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
struct lttng_kernel_context {
enum lttng_kernel_context_type ctx;
+ char padding[LTTNG_KERNEL_CONTEXT_PADDING1];
+
union {
struct lttng_kernel_perf_counter_ctx perf_counter;
+ char padding[LTTNG_KERNEL_CONTEXT_PADDING2];
} u;
};
uint64_t addr;
uint64_t offset;
- char symbol_name[LTTNG_SYM_NAME_LEN];
+ char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
};
/*
uint64_t addr;
uint64_t offset;
- char symbol_name[LTTNG_SYM_NAME_LEN];
+ char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
};
/* Function tracer */
struct lttng_kernel_function {
- char symbol_name[LTTNG_SYM_NAME_LEN];
+ char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
};
+#define LTTNG_KERNEL_EVENT_PADDING1 16
+#define LTTNG_KERNEL_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
struct lttng_kernel_event {
- char name[LTTNG_SYM_NAME_LEN];
+ char name[LTTNG_KERNEL_SYM_NAME_LEN];
enum lttng_kernel_instrumentation instrumentation;
+ char padding[LTTNG_KERNEL_EVENT_PADDING1];
+
/* Per instrumentation type configuration */
union {
struct lttng_kernel_kretprobe kretprobe;
struct lttng_kernel_kprobe kprobe;
struct lttng_kernel_function ftrace;
+ char padding[LTTNG_KERNEL_EVENT_PADDING2];
} u;
};
struct ltt_kernel_event *event;
struct lttng_event ev;
- strncpy(ev.name, get_random_string(), LTTNG_SYM_NAME_LEN);
+ strncpy(ev.name, get_random_string(), LTTNG_KERNEL_SYM_NAME_LEN);
ev.type = LTTNG_EVENT_TRACEPOINT;
printf("Creating kernel event: ");