X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=9686b7d0fa4b9d172ab28fb9619656771ebfdc95;hp=536d41baa2bc4848b334405afa598a210dc5422e;hb=5cdb6027a2b78fd93aa7f61174625190b5fc3459;hpb=c7e35b037773dbbfe10178c946ba44feefb226e1 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 536d41baa..9686b7d0f 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -105,6 +105,7 @@ void lttng_ctl_copy_lttng_domain(struct lttng_domain *dst, case LTTNG_DOMAIN_KERNEL: case LTTNG_DOMAIN_UST: case LTTNG_DOMAIN_JUL: + case LTTNG_DOMAIN_LOG4J: memcpy(dst, src, sizeof(struct lttng_domain)); break; default: @@ -825,6 +826,12 @@ static int generate_filter(char *filter_expression, ret = -LTTNG_ERR_FILTER_INVAL; goto parse_error; } + /* Validate strings used as literals in the expression */ + ret = filter_visitor_ir_validate_string(ctx); + if (ret) { + ret = -LTTNG_ERR_FILTER_INVAL; + goto parse_error; + } dbg_printf("done\n"); dbg_printf("Generating bytecode... "); @@ -932,7 +939,8 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, * filtering by logger name. */ if (exclusion_count == 0 && filter_expression == NULL && - handle->domain.type != LTTNG_DOMAIN_JUL) { + (handle->domain.type != LTTNG_DOMAIN_JUL && + handle->domain.type != LTTNG_DOMAIN_LOG4J)) { goto ask_sessiond; } @@ -942,8 +950,10 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, */ /* Parse filter expression */ - if (filter_expression != NULL || handle->domain.type == LTTNG_DOMAIN_JUL) { - if (handle->domain.type == LTTNG_DOMAIN_JUL) { + if (filter_expression != NULL || handle->domain.type == LTTNG_DOMAIN_JUL + || handle->domain.type == LTTNG_DOMAIN_LOG4J) { + if (handle->domain.type == LTTNG_DOMAIN_JUL || + handle->domain.type == LTTNG_DOMAIN_LOG4J) { char *jul_filter; /* Setup JUL filter if needed. */