Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jp_ikaheimonen@mentor.com (JP Ikaheimonen)
Subject: [lttng-dev] [PATCH lttng-tools 12/28] Collate handling of LTTNG_ENABLE_EVENT_WITH_FILTER
Date: Thu,  7 Nov 2013 12:21:36 +0200	[thread overview]
Message-ID: <1383819703-6793-3-git-send-email-jp_ikaheimonen@mentor.com> (raw)
In-Reply-To: <1383819703-6793-1-git-send-email-jp_ikaheimonen@mentor.com>

Because the handling of LTTNG_ENABLE_EVENT_WITH_EXCLUSION can
now handle commands of type LTTNG_ENABLE_EVENT_WITH_FILTER,
there's no reason to have the same code appear twice.

Remove the code for LTTNG_ENABLE_EVENT_WITH_FILTER and use the
same code as is used for LTTNG_ENABLE_EVENT_WITH_EXCLUSION.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen at mentor.com>
---
 src/bin/lttng-sessiond/main.c | 41 +----------------------------------------
 1 file changed, 1 insertion(+), 40 deletions(-)

diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index ab7d49b..7194fd5 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
@@ -2931,6 +2931,7 @@ skip_domain:
 	}
 	case LTTNG_ENABLE_EVENT:
 	case LTTNG_ENABLE_EVENT_WITH_EXCLUSION:
+	case LTTNG_ENABLE_EVENT_WITH_FILTER:
 	{
 		struct lttng_event_exclusion *exclusion = NULL;
 		struct lttng_filter_bytecode *bytecode = NULL;
@@ -3320,46 +3321,6 @@ skip_domain:
 				cmd_ctx->lsm->u.reg.path, cdata);
 		break;
 	}
-	case LTTNG_ENABLE_EVENT_WITH_FILTER:
-	{
-		struct lttng_filter_bytecode *bytecode;
-
-		if (cmd_ctx->lsm->u.enable.bytecode_len > LTTNG_FILTER_MAX_LEN) {
-			ret = LTTNG_ERR_FILTER_INVAL;
-			goto error;
-		}
-		if (cmd_ctx->lsm->u.enable.bytecode_len == 0) {
-			ret = LTTNG_ERR_FILTER_INVAL;
-			goto error;
-		}
-		bytecode = zmalloc(cmd_ctx->lsm->u.enable.bytecode_len);
-		if (!bytecode) {
-			ret = LTTNG_ERR_FILTER_NOMEM;
-			goto error;
-		}
-		/* Receive var. len. data */
-		DBG("Receiving var len data from client ...");
-		ret = lttcomm_recv_unix_sock(sock, bytecode,
-				cmd_ctx->lsm->u.enable.bytecode_len);
-		if (ret <= 0) {
-			DBG("Nothing recv() from client var len data... continuing");
-			*sock_error = 1;
-			ret = LTTNG_ERR_FILTER_INVAL;
-			goto error;
-		}
-
-		if (bytecode->len + sizeof(*bytecode)
-				!= cmd_ctx->lsm->u.enable.bytecode_len) {
-			free(bytecode);
-			ret = LTTNG_ERR_FILTER_INVAL;
-			goto error;
-		}
-
-		ret = cmd_enable_event(cmd_ctx->session, &cmd_ctx->lsm->domain,
-				cmd_ctx->lsm->u.enable.channel_name,
-				&cmd_ctx->lsm->u.enable.event, bytecode, NULL, kernel_poll_pipe[1]);
-		break;
-	}
 	case LTTNG_DATA_PENDING:
 	{
 		ret = cmd_data_pending(cmd_ctx->session);
-- 
1.8.1.2




  parent reply	other threads:[~2013-11-07 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 10:21 [lttng-dev] [PATCH lttng-tools 10/28] Add new error codes for exclusion processing JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 11/28] Add handling of LTTNG_ENABLE_EVENT_WITH_EXCLUSION JP Ikaheimonen
2013-11-07 10:21 ` JP Ikaheimonen [this message]
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 13/28] Add exclusion data to ust_app_event structure JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 14/28] Compare also exclusions in ht_match_ust_app_event JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 15/28] Copy event exclusion data in add_unique_ust_app_event JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 16/28] Free exclusion data when ust_app_event is deleted JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 17/28] Add exclusion data to find_ust_app_event JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 18/28] Copy exclusion data in shadow_copy_event JP Ikaheimonen
2013-11-07 10:21 ` [lttng-dev] [PATCH lttng-tools 19/28] Set event exclusions in the target when event is created JP Ikaheimonen

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=1383819703-6793-3-git-send-email-jp_ikaheimonen@mentor.com \
    --to=jp_ikaheimonen@mentor.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