sessiond: add loglevels_match()
[lttng-tools.git] / src / bin / lttng-sessiond / agent.c
index 7797f8c26b57edd869ad651fcb31b175fbba4604..10e8b1f3a89ca859478a95c6855223ba5e069ced 100644 (file)
@@ -65,6 +65,7 @@ static int ht_match_event(struct cds_lfht_node *node,
 {
        struct agent_event *event;
        const struct agent_ht_key *key;
+       int ll_match;
 
        assert(node);
        assert(_key);
@@ -80,19 +81,11 @@ static int ht_match_event(struct cds_lfht_node *node,
        }
 
        /* Event loglevel value and type. */
-       if (event->loglevel_type == key->loglevel_type) {
-               /* Same loglevel type. */
-               if (key->loglevel_type != LTTNG_EVENT_LOGLEVEL_ALL) {
-                       /*
-                        * Loglevel value must also match since the loglevel
-                        * type is not all.
-                        */
-                       if (event->loglevel_value != key->loglevel_value) {
-                               goto no_match;
-                       }
-               }
-       } else {
-               /* Loglevel type is different: no match. */
+       ll_match = loglevels_match(event->loglevel_type,
+               event->loglevel_value, key->loglevel_type,
+               key->loglevel_value, LTTNG_EVENT_LOGLEVEL_ALL);
+
+       if (!ll_match) {
                goto no_match;
        }
 
This page took 0.024298 seconds and 4 git commands to generate.