Use empty event name on disable -a for ust and agent domain
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 21 Sep 2015 22:43:55 +0000 (18:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 22 Sep 2015 16:25:54 +0000 (12:25 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
tests/regression/ust/python-logging/test_python_logging.in

index ab57fee86bee8f3a54ebb71001b6ecb9ebeced67..5390d7332e8a33b58233b41e2771ebc635af99e1 100644 (file)
@@ -1274,10 +1274,12 @@ int cmd_disable_event(struct ltt_session *session, int domain,
 
                switch (event->type) {
                case LTTNG_EVENT_ALL:
-                       if (strlen(event->name) == 1 &&
-                                       !strncmp(event->name, "*", 1)) {
-                               ret = event_ust_disable_all_tracepoints(usess,
-                                               uchan);
+                       /*
+                        * An empty event name means that everything
+                        * should be disabled.
+                        */
+                       if (event->name[0] == '\0') {
+                               ret = event_ust_disable_all_tracepoints(usess, uchan);
                        } else {
                                ret = event_ust_disable_tracepoint(usess, uchan,
                                                event_name);
@@ -1317,8 +1319,11 @@ int cmd_disable_event(struct ltt_session *session, int domain,
                        ret = -LTTNG_ERR_UST_EVENT_NOT_FOUND;
                        goto error_unlock;
                }
-               /* The wild card * means that everything should be disabled. */
-               if (strncmp(event->name, "*", 1) == 0 && strlen(event->name) == 1) {
+               /*
+                * An empty event name means that everything
+                * should be disabled.
+                */
+               if (event->name[0] == '\0') {
                        ret = event_agent_disable_all(usess, agt);
                } else {
                        ret = event_agent_disable(usess, agt, event_name);
index 8aff4081ed4ab21ea041aea403795a0bec18ee08..d5a9b80399633f1bb00aee18293a3d3b5604b630 100755 (executable)
@@ -351,7 +351,7 @@ function test_python_disable_all()
        enable_python_lttng_event $SESSION_NAME $EVENT_NAME
        enable_python_lttng_event $SESSION_NAME $EVENT_NAME2
 
-       disable_python_lttng_event $SESSION_NAME '*'
+       disable_python_lttng_event $SESSION_NAME -a
 
        start_lttng_tracing_ok $SESSION_NAME
 
This page took 0.029039 seconds and 4 git commands to generate.