Update lttng-kernel.h with padding
authorDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 17:27:35 +0000 (12:27 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 17:27:35 +0000 (12:27 -0500)
Rename LTTNG_SYM_NAME_LEN to LTTNG_KERNEL_SYM_NAME_LEN. (following
lttng-modules ABI).

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/trace-kernel.c
src/common/lttng-kernel.h
tests/test_kernel_data_trace.c

index 7de98b03a4eb745f746fee239e71e1db7901b2ab..36f7c9708a8f47e0fa33d9ce579a33c0bf607e08 100644 (file)
@@ -184,8 +184,8 @@ struct ltt_kernel_event *trace_kernel_create_event(struct lttng_event *ev)
                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;
@@ -193,14 +193,14 @@ struct ltt_kernel_event *trace_kernel_create_event(struct lttng_event *ev)
                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;
@@ -217,8 +217,8 @@ struct ltt_kernel_event *trace_kernel_create_event(struct lttng_event *ev)
        }
 
        /* 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;
index 6451c9638db4c007bc5fc5b5b11ac48496e1b3a8..e1d99ceee0bdd5ae366f196ab94da53d4b8efaee 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <stdint.h>
 
-#define LTTNG_SYM_NAME_LEN  256
+#define LTTNG_KERNEL_SYM_NAME_LEN  256
 
 /*
  * LTTng DebugFS ABI structures.
@@ -58,14 +58,19 @@ enum lttng_kernel_context_type {
 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;
 };
 
@@ -73,7 +78,7 @@ struct lttng_kernel_kretprobe {
        uint64_t addr;
 
        uint64_t offset;
-       char symbol_name[LTTNG_SYM_NAME_LEN];
+       char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
 };
 
 /*
@@ -83,22 +88,27 @@ struct lttng_kernel_kprobe {
        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;
 };
 
index 30d79a4eb44ccb0bc840d2b656679b02f7e6c2c5..6dba1f523a42089c38f70ead89cf48482d345887 100644 (file)
@@ -141,7 +141,7 @@ static void create_kernel_event(void)
        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: ");
This page took 0.031066 seconds and 4 git commands to generate.