From: Jonathan Rajotte Date: Mon, 21 Sep 2015 22:43:55 +0000 (-0400) Subject: Use empty event name on disable -a for ust and agent domain X-Git-Tag: v2.8.0-rc1~307 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b3639870e5ddf9a2cbb9ab6cb2ccdaf15447b8c8;p=lttng-tools.git Use empty event name on disable -a for ust and agent domain Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index b866f73a6..65d1d090e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1280,10 +1280,12 @@ int cmd_disable_event(struct ltt_session *session, 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); @@ -1323,8 +1325,11 @@ int cmd_disable_event(struct ltt_session *session, 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); diff --git a/tests/regression/ust/python-logging/test_python_logging.in b/tests/regression/ust/python-logging/test_python_logging.in index 8aff4081e..d5a9b8039 100755 --- a/tests/regression/ust/python-logging/test_python_logging.in +++ b/tests/regression/ust/python-logging/test_python_logging.in @@ -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