[lttng-dev] [PATCH lttng-tools 12/28] Collate handling of LTTNG_ENABLE_EVENT_WITH_FILTER
JP Ikaheimonen
jp_ikaheimonen at mentor.com
Thu Nov 7 05:21:36 EST 2013
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
More information about the lttng-dev
mailing list