- if (event->loglevel != key->loglevel) {
- if (event->loglevel_type == LTTNG_EVENT_LOGLEVEL_ALL &&
- key->loglevel == 0 && event->loglevel == -1) {
- goto match;
+ /* 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;
+ }