Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte)
Subject: [lttng-dev] [PATCH lttng-tools 2/4 v2] Use empty event name on disable -a for ust and agent domain
Date: Mon, 21 Sep 2015 18:43:55 -0400	[thread overview]
Message-ID: <1442875437-15639-2-git-send-email-jonathan.rajotte-julien@efficios.com> (raw)
In-Reply-To: <1442875437-15639-1-git-send-email-jonathan.rajotte-julien@efficios.com>

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-sessiond/cmd.c                            | 17 +++++++++++------
 .../ust/python-logging/test_python_logging.in           |  2 +-
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index 0daeb9e..5a1cc7a 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 8aff408..d5a9b80 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
 
-- 
2.1.4




  reply	other threads:[~2015-09-21 22:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1442522277-31518-1-git-send-email-jonathan.rajotte-julien@efficios.com>
     [not found] ` <CA+jJMxscPwme95++cjrQU3eBPB8Tw88SDOQ0+rXrfvJS6t_gAw@mail.gmail.com>
2015-09-21 16:26   ` [lttng-dev] [PATCH lttng-tools 1/3] Fix: disable kernel event based on name and event type Jérémie Galarneau
2015-09-21 19:00 ` Jérémie Galarneau
2015-09-21 19:15   ` Jérémie Galarneau
2015-09-21 22:32   ` Jonathan Rajotte Julien
2015-09-21 19:29 ` Jérémie Galarneau
2015-09-21 22:43   ` [lttng-dev] [PATCH lttng-tools 1/4 v2] " Jonathan Rajotte
2015-09-21 22:43     ` Jonathan Rajotte [this message]
2015-09-21 22:43     ` [lttng-dev] [PATCH lttng-tools 3/4 v2] man: update disable-event section Jonathan Rajotte
2015-09-21 22:43     ` [lttng-dev] [PATCH lttng-tools 4/4 v2] Help: add -j -l -p option to help string Jonathan Rajotte
2015-09-22 17:47     ` [lttng-dev] [PATCH lttng-tools 1/4 v2] Fix: disable kernel event based on name and event type Jérémie Galarneau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442875437-15639-2-git-send-email-jonathan.rajotte-julien@efficios.com \
    --to=jonathan.rajotte-julien@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox