Fix: don't print the default channel name when enabling agent events
authorAntoine Busque <abusque@efficios.com>
Wed, 2 Sep 2015 00:21:00 +0000 (20:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 04:35:35 +0000 (00:35 -0400)
Enabling an event in the python domain erroneously reported the
channel as being the default `channel0`. Instead, don't report the
channel name when enabling an event in an agent domain.

Fixes: #910
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_events.c

index 50734c05906084778001c190a85e7d18a729e6cb..063c7cc35a9846728e71dd2eb24a7eaebc8960dc 100644 (file)
@@ -1156,17 +1156,28 @@ static int enable_events(char *session_name)
                                }
                                error_holder = command_ret;
                        } else {
-                               /* So we don't print the default channel name for agent domain. */
-                               if (dom.type == LTTNG_DOMAIN_JUL ||
-                                               dom.type == LTTNG_DOMAIN_LOG4J) {
-                                       MSG("%s event %s%s enabled.",
-                                                       get_domain_str(dom.type), event_name,
-                                                       exclusion_string);
-                               } else {
+                               switch (dom.type) {
+                               case LTTNG_DOMAIN_KERNEL:
+                               case LTTNG_DOMAIN_UST:
                                        MSG("%s event %s%s created in channel %s",
-                                                       get_domain_str(dom.type), event_name,
-                                                       exclusion_string,
-                                                       print_channel_name(channel_name));
+                                               get_domain_str(dom.type),
+                                               event_name,
+                                               exclusion_string,
+                                               print_channel_name(channel_name));
+                                       break;
+                               case LTTNG_DOMAIN_JUL:
+                               case LTTNG_DOMAIN_LOG4J:
+                                       /*
+                                        * Don't print the default channel
+                                        * name for agent domains.
+                                        */
+                                       MSG("%s event %s%s enabled.",
+                                               get_domain_str(dom.type),
+                                               event_name,
+                                               exclusion_string);
+                                       break;
+                               default:
+                                       assert(0);
                                }
                        }
                        free(exclusion_string);
This page took 0.026899 seconds and 4 git commands to generate.