listing and activation of loglevel by number
[lttng-tools.git] / lttng / commands / enable_events.c
index 5740d3cbcf95547c72f8d20080da7d8f4318140d..45cef9f60c7a6b55cd76c3ad7dc6379b9e951a2e 100644 (file)
@@ -335,19 +335,21 @@ static int enable_events(char *session_name)
                        }
                        DBG("Enabling UST event %s for channel %s",
                                        event_name, channel_name);
-                       /* Copy name and type of the event */
-                       strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
-                       ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
-                       ev.type = opt_event_type;
 
                        switch (opt_event_type) {
                        case LTTNG_EVENT_ALL:   /* Default behavior is tracepoint */
-                               ev.type = LTTNG_EVENT_TRACEPOINT;
                                /* Fall-through */
                        case LTTNG_EVENT_TRACEPOINT:
+                               /* Copy name and type of the event */
+                               ev.type = LTTNG_EVENT_TRACEPOINT;
+                               strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
+                               ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
                                break;
                        case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
+                               /* Copy name and type of the event */
                                ev.type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL;
+                               strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
+                               ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
                                break;
                        case LTTNG_EVENT_PROBE:
                        case LTTNG_EVENT_FUNCTION:
This page took 0.031019 seconds and 4 git commands to generate.