X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=178c7d04eb9f6f3ede96c59bdd82616975820168;hp=b7ef806af1a5a218cdfa7ccc2f1b4c6e04691f98;hb=890d8fe47755c3bad936389cf48ffa141cff41c9;hpb=b953b8cd56dbdc30e9228a7334c6e5fbe302cfc7 diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index b7ef806af..178c7d04e 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -72,6 +71,7 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key) struct ltt_ust_event *event; const struct ltt_ust_ht_key *key; int ev_loglevel_value; + int ll_match; assert(node); assert(_key); @@ -88,19 +88,11 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key) } /* Event loglevel value and type. */ - if (event->attr.loglevel_type == key->loglevel_type) { - /* Same loglevel type. */ - if (key->loglevel_type != LTTNG_UST_LOGLEVEL_ALL) { - /* - * Loglevel value must also match since the loglevel - * type is not all. - */ - if (ev_loglevel_value != key->loglevel_value) { - goto no_match; - } - } - } else { - /* Loglevel type is different: no match. */ + ll_match = loglevels_match(event->attr.loglevel_type, + ev_loglevel_value, key->loglevel_type, + key->loglevel_value, LTTNG_UST_LOGLEVEL_ALL); + + if (!ll_match) { goto no_match; }