Use LTTNG_KERNEL_SYM_NAME_LEN
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Feb 2012 17:03:21 +0000 (12:03 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Feb 2012 17:03:21 +0000 (12:03 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-abi.c
lttng-abi.h
lttng-syscalls.c
probes/lttng-kprobes.c

index 2b673776b44ce2e2a36c2567668ec297e1d99bd3..c44989549ef64a217c6901153f08bd4734972ba3 100644 (file)
@@ -175,7 +175,7 @@ long lttng_abi_add_context(struct file *file,
        case LTTNG_KERNEL_CONTEXT_VPPID:
                return lttng_add_vppid_to_ctx(ctx);
        case LTTNG_KERNEL_CONTEXT_PERF_COUNTER:
-               context_param.u.perf_counter.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               context_param.u.perf_counter.name[LTTNG_KERNEL_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,
@@ -500,16 +500,16 @@ int lttng_abi_create_event(struct file *channel_file,
 
        if (copy_from_user(&event_param, uevent_param, sizeof(event_param)))
                return -EFAULT;
-       event_param.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+       event_param.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
        switch (event_param.instrumentation) {
        case LTTNG_KERNEL_KRETPROBE:
-               event_param.u.kretprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               event_param.u.kretprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                break;
        case LTTNG_KERNEL_KPROBE:
-               event_param.u.kprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               event_param.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                break;
        case LTTNG_KERNEL_FUNCTION:
-               event_param.u.ftrace.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               event_param.u.ftrace.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                break;
        default:
                break;
index 9c88b9b9db5887a57569d0265e1cb63e68d6ab81..b5410d49b19cf7adee3e75ab12a31c59ce66f0c0 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/fs.h>
 
-#define LTTNG_SYM_NAME_LEN     256
+#define LTTNG_KERNEL_SYM_NAME_LEN      256
 
 enum lttng_kernel_instrumentation {
        LTTNG_KERNEL_TRACEPOINT = 0,
@@ -35,7 +35,6 @@ enum lttng_kernel_output {
 /*
  * LTTng DebugFS ABI structures.
  */
-
 struct lttng_kernel_channel {
        int overwrite;                          /* 1: overwrite, 0: discard */
        uint64_t subbuf_size;                   /* in bytes */
@@ -49,7 +48,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];
 };
 
 /*
@@ -59,18 +58,18 @@ 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];
 };
 
 struct lttng_kernel_function_tracer {
-       char symbol_name[LTTNG_SYM_NAME_LEN];
+       char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
 };
 
 /*
  * For syscall tracing, name = '\0' means "enable all".
  */
 struct lttng_kernel_event {
-       char name[LTTNG_SYM_NAME_LEN];  /* event name */
+       char name[LTTNG_KERNEL_SYM_NAME_LEN];   /* event name */
        enum lttng_kernel_instrumentation instrumentation;
        /* Per instrumentation type configuration */
        union {
@@ -110,7 +109,7 @@ 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];
 };
 
 struct lttng_kernel_context {
index 521531c35bef2ab52529428de85499b592622936..b8a1813c7c5f3506d1dd8fdd12b334863d7134de 100644 (file)
@@ -295,8 +295,8 @@ int fill_table(const struct trace_syscall_entry *table, size_t table_len,
                if (chan_table[i])
                        continue;
                memset(&ev, 0, sizeof(ev));
-               strncpy(ev.name, desc->name, LTTNG_SYM_NAME_LEN);
-               ev.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
+               ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                ev.instrumentation = LTTNG_KERNEL_NOOP;
                chan_table[i] = lttng_event_create(chan, &ev, filter,
                                                desc);
@@ -342,8 +342,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
                        &__event_desc___sys_unknown;
 
                memset(&ev, 0, sizeof(ev));
-               strncpy(ev.name, desc->name, LTTNG_SYM_NAME_LEN);
-               ev.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
+               ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                ev.instrumentation = LTTNG_KERNEL_NOOP;
                chan->sc_unknown = lttng_event_create(chan, &ev, filter,
                                                    desc);
@@ -357,8 +357,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
                        &__event_desc___compat_sys_unknown;
 
                memset(&ev, 0, sizeof(ev));
-               strncpy(ev.name, desc->name, LTTNG_SYM_NAME_LEN);
-               ev.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
+               ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                ev.instrumentation = LTTNG_KERNEL_NOOP;
                chan->sc_compat_unknown = lttng_event_create(chan, &ev, filter,
                                                           desc);
@@ -372,8 +372,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
                        &__event_desc___exit_syscall;
 
                memset(&ev, 0, sizeof(ev));
-               strncpy(ev.name, desc->name, LTTNG_SYM_NAME_LEN);
-               ev.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+               strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
+               ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
                ev.instrumentation = LTTNG_KERNEL_NOOP;
                chan->sc_exit = lttng_event_create(chan, &ev, filter,
                                                 desc);
index e9c64960720ce877cdff1b01f505d62f6d00a5b5..69aff68f1943ffcda21a9e77901bb82c01334c22 100644 (file)
@@ -107,14 +107,14 @@ int lttng_kprobes_register(const char *name,
        event->u.kprobe.kp.pre_handler = lttng_kprobes_handler_pre;
        if (symbol_name) {
                event->u.kprobe.symbol_name =
-                       kzalloc(LTTNG_SYM_NAME_LEN * sizeof(char),
+                       kzalloc(LTTNG_KERNEL_SYM_NAME_LEN * sizeof(char),
                                GFP_KERNEL);
                if (!event->u.kprobe.symbol_name) {
                        ret = -ENOMEM;
                        goto name_error;
                }
                memcpy(event->u.kprobe.symbol_name, symbol_name,
-                      LTTNG_SYM_NAME_LEN * sizeof(char));
+                      LTTNG_KERNEL_SYM_NAME_LEN * sizeof(char));
                event->u.kprobe.kp.symbol_name =
                        event->u.kprobe.symbol_name;
        }
This page took 0.030123 seconds and 4 git commands to generate.