X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=1bc3c77806ae563e5fb972475ed11d49d5e4035d;hb=e9a89251285e6d02dbe8c7b51f0f1b200e200a1f;hp=8da942f01c8d9a7bc835804adf57f542edd7b062;hpb=79a065a0fe068ab28e99ae11357a219d62dcbdce;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 8da942f01..1bc3c7780 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -86,19 +86,21 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key) goto no_match; } - /* Event loglevel. */ - if (ev_loglevel_value != key->loglevel_type) { - if (event->attr.loglevel_type == LTTNG_UST_LOGLEVEL_ALL - && key->loglevel_type == 0 && ev_loglevel_value == -1) { + /* Event loglevel value and type. */ + if (event->attr.loglevel_type == key->loglevel_type) { + /* Same loglevel type. */ + if (key->loglevel_type != LTTNG_UST_LOGLEVEL_ALL) { /* - * Match is accepted. This is because on event creation, the - * loglevel is set to -1 if the event loglevel type is ALL so 0 and - * -1 are accepted for this loglevel type since 0 is the one set by - * the API when receiving an enable event. + * Loglevel value must also match since the loglevel + * type is not all. */ - } else { - goto no_match; + if (ev_loglevel_value != key->loglevel_value) { + goto no_match; + } } + } else { + /* Loglevel type is different: no match. */ + goto no_match; } /* Only one of the filters is NULL, fail. */ @@ -173,7 +175,8 @@ error: */ struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht, char *name, struct lttng_filter_bytecode *filter, - int loglevel_value, struct lttng_event_exclusion *exclusion) + enum lttng_ust_loglevel_type loglevel_type, int loglevel_value, + struct lttng_event_exclusion *exclusion) { struct lttng_ht_node_str *node; struct lttng_ht_iter iter; @@ -184,7 +187,8 @@ struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht, key.name = name; key.filter = filter; - key.loglevel_type = loglevel_value; + key.loglevel_type = loglevel_type; + key.loglevel_value = loglevel_value; key.exclusion = exclusion; cds_lfht_lookup(ht->ht, ht->hash_fct((void *) name, lttng_ht_seed),