Fix: Warn that kernel loglevels are unsupported
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 13 Nov 2013 20:43:58 +0000 (15:43 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 13 Nov 2013 21:15:49 +0000 (16:15 -0500)
Warn the user when the log level option is used when the kernel domain
is selected. Also, don't show the log level in the confirmation message
when kernel events are selected.

Fixes Bug #645

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/enable_events.c

index a7b70c3f9dada482aa76cdd3113ccfa61535d4e0..2dff63b92fb4969423f6b9e0a2f84c5f44d6a89f 100644 (file)
@@ -346,6 +346,9 @@ static int enable_events(char *session_name)
                        ret = CMD_ERROR;
                        goto error;
                }
+               if (opt_loglevel) {
+                       WARN("Kernel loglevels are not supported.");
+               }
        }
 
        /* Create lttng domain */
@@ -419,7 +422,7 @@ static int enable_events(char *session_name)
 
                        switch (opt_event_type) {
                        case LTTNG_EVENT_TRACEPOINT:
-                               if (opt_loglevel) {
+                               if (opt_loglevel && dom.type != LTTNG_DOMAIN_KERNEL) {
                                        MSG("All %s tracepoints are enabled in channel %s for loglevel %s",
                                                        get_domain_str(dom.type),
                                                        print_channel_name(channel_name),
@@ -428,7 +431,6 @@ static int enable_events(char *session_name)
                                        MSG("All %s tracepoints are enabled in channel %s",
                                                        get_domain_str(dom.type),
                                                        print_channel_name(channel_name));
-
                                }
                                break;
                        case LTTNG_EVENT_SYSCALL:
@@ -438,7 +440,7 @@ static int enable_events(char *session_name)
                                }
                                break;
                        case LTTNG_EVENT_ALL:
-                               if (opt_loglevel) {
+                               if (opt_loglevel && dom.type != LTTNG_DOMAIN_KERNEL) {
                                        MSG("All %s events are enabled in channel %s for loglevel %s",
                                                        get_domain_str(dom.type),
                                                        print_channel_name(channel_name),
@@ -533,12 +535,6 @@ static int enable_events(char *session_name)
                                goto error;
                        }
 
-                       if (opt_loglevel) {
-                               MSG("Kernel loglevels are not supported.");
-                               ret = CMD_UNSUPPORTED;
-                               goto error;
-                       }
-
                        /* kernel loglevels not implemented */
                        ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
                } else if (opt_userspace) {             /* User-space tracer action */
This page took 0.035517 seconds and 4 git commands to generate.