X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=21197171c567c2215e81557427318ca66f56bc84;hb=561c68970ca461ccf8451aee47efc29da20ad8f1;hp=b64597599caaaa9e127306f0c1b0bee806c508f0;hpb=0475c50c4d3d2cea973fe4d1f17875d231dea96c;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index b64597599..21197171c 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -75,7 +75,7 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key) event = caa_container_of(node, struct ltt_ust_event, node.node); key = _key; - /* Match the 3 elements of the key: name, filter and loglevel. */ + /* Match the 4 elements of the key: name, filter, loglevel, exclusions. */ /* Event name */ if (strncmp(event->attr.name, key->name, sizeof(event->attr.name)) != 0) { @@ -111,6 +111,19 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key) } } + /* If only one of the exclusions is NULL, fail. */ + if ((key->exclusion && !event->exclusion) || (!key->exclusion && event->exclusion)) { + goto no_match; + } + + if (key->exclusion && event->exclusion) { + /* Both exclusions exist; check count followed by names. */ + if (event->exclusion->count != key->exclusion->count || + memcmp(event->exclusion->names, key->exclusion->names, + event->exclusion->count * LTTNG_SYMBOL_NAME_LEN) != 0) { + goto no_match; + } + } /* Match. */ return 1; @@ -317,7 +330,8 @@ error: * Return pointer to structure or NULL. */ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, - struct lttng_filter_bytecode *filter) + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion) { struct ltt_ust_event *lue; @@ -371,6 +385,7 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, /* Same layout. */ lue->filter = (struct lttng_ust_filter_bytecode *) filter; + lue->exclusion = (struct lttng_event_exclusion *) exclusion; /* Init node */ lttng_ht_node_init_str(&lue->node, lue->attr.name);