X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ffilter.c;h=1088cbed58e34e27fa023b538670075ebc9cc8f9;hp=e887533050f8a5f298bbcd7944f63fac59eef416;hb=178191b3899f114001f000c2e7f46909969f9c6f;hpb=49c336c1679295a31b92223dca05feccfe3e3464 diff --git a/src/bin/lttng-sessiond/filter.c b/src/bin/lttng-sessiond/filter.c index e88753305..1088cbed5 100644 --- a/src/bin/lttng-sessiond/filter.c +++ b/src/bin/lttng-sessiond/filter.c @@ -46,6 +46,7 @@ static int add_ufilter_to_event(struct ltt_ust_session *usess, int domain, } /* Same layout. */ uevent->filter = (struct lttng_ust_filter_bytecode *) bytecode; + uevent->filter->seqnum = usess->filter_seq_num; switch (domain) { case LTTNG_DOMAIN_UST: @@ -54,6 +55,7 @@ static int add_ufilter_to_event(struct ltt_ust_session *usess, int domain, if (ret < 0) { goto error; } + usess->filter_seq_num++; break; default: ret = -ENOSYS; @@ -73,7 +75,7 @@ error: * Add UST context to tracer. */ int filter_ust_set(struct ltt_ust_session *usess, int domain, - struct lttng_filter_bytecode *bytecode, char *event_name, + struct lttng_filter_bytecode *bytecode, struct lttng_event *event, char *channel_name) { int ret = LTTNG_OK, have_event = 0; @@ -100,8 +102,8 @@ int filter_ust_set(struct ltt_ust_session *usess, int domain, goto error; } - /* Do we have an event name */ - if (strlen(event_name) != 0) { + /* Do we have a valid event. */ + if (event && event->name[0] != '\0') { have_event = 1; } @@ -116,7 +118,7 @@ int filter_ust_set(struct ltt_ust_session *usess, int domain, /* If UST channel specified and event name, get UST event ref */ if (uchan && have_event) { - uevent = trace_ust_find_event_by_name(uchan->events, event_name); + uevent = trace_ust_find_event_by_name(uchan->events, event->name); if (uevent == NULL) { ret = LTTNG_ERR_UST_EVENT_NOT_FOUND; goto error; @@ -135,7 +137,7 @@ int filter_ust_set(struct ltt_ust_session *usess, int domain, } else if (!uchan && have_event) { /* Add filter to event */ /* Add context to event without having the channel name */ cds_lfht_for_each_entry(chan_ht->ht, &iter.iter, uchan, node.node) { - uevent = trace_ust_find_event_by_name(uchan->events, event_name); + uevent = trace_ust_find_event_by_name(uchan->events, event->name); if (uevent != NULL) { ret = add_ufilter_to_event(usess, domain, uchan, uevent, bytecode); /*