Fix: kernels 3.0.x do not implement IS_ENABLED macro
[lttng-modules.git] / src / lttng-syscalls.c
index 2e8324133d53ed069ec325bd29fd958ca6360d28..bf1f2b732217397cf3e489bdb3e5f260f24dc361 100644 (file)
@@ -642,14 +642,15 @@ void lttng_syscall_event_enabler_create_matching_syscall_table_events(struct ltt
        const struct lttng_kernel_event_desc *desc;
        unsigned int i;
 
-       if (!IS_ENABLED(CONFIG_COMPAT) && (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT))
+#ifndef CONFIG_COMPAT
+       if (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT)
                return;
-
+#endif
        /* iterate over all syscall and create event that match */
        for (i = 0; i < table_len; i++) {
                struct lttng_kernel_event_common_private *event_priv;
                struct hlist_head *head;
-               int found = 0;
+               bool found = false;
 
                desc = table[i].desc;
                if (!desc) {
@@ -665,8 +666,10 @@ void lttng_syscall_event_enabler_create_matching_syscall_table_events(struct ltt
                 */
                head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, desc->event_name);
                lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
-                       if (lttng_event_enabler_desc_match_event(syscall_event_enabler_common, desc, event_priv->pub))
-                               found = 1;
+                       if (lttng_event_enabler_desc_match_event(syscall_event_enabler_common, desc, event_priv->pub)) {
+                               found = true;
+                               break;
+                       }
                }
                if (found)
                        continue;
@@ -700,9 +703,10 @@ void create_unknown_syscall_event(struct lttng_event_enabler_common *event_enabl
        bool found = false;
        struct hlist_head *head;
 
-       if (!IS_ENABLED(CONFIG_COMPAT) && (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT))
+#ifndef CONFIG_COMPAT
+       if (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT)
                return;
-
+#endif
        /*
         * Considering that currently system calls can only be enabled on a per
         * name basis (or wildcard based on a name), unknown syscall events are
@@ -741,8 +745,10 @@ void create_unknown_syscall_event(struct lttng_event_enabler_common *event_enabl
         */
        head = utils_borrow_hash_table_bucket(events_ht->table, LTTNG_EVENT_HT_SIZE, desc->event_name);
        lttng_hlist_for_each_entry(event_priv, head, hlist_node) {
-               if (lttng_event_enabler_desc_match_event(event_enabler, desc, event_priv->pub))
+               if (lttng_event_enabler_desc_match_event(event_enabler, desc, event_priv->pub)) {
                        found = true;
+                       break;
+               }
        }
        if (!found)
                lttng_syscall_event_enabler_create_event(event_enabler, desc, unknown_dispatch_list, type, -1U);
This page took 0.023668 seconds and 4 git commands to generate.