liblttng-ust: exit loop early on event enabler match
[lttng-ust.git] / liblttng-ust / lttng-events.c
index 855f8d8739d1ff0ecb07d6779957c4f11153f9db..f68ce323690ae2eba56bed6fae375e7490cc926d 100644 (file)
@@ -766,8 +766,10 @@ void lttng_create_event_if_missing(struct lttng_enabler *enabler)
                        head = &session->events_ht.table[hash & (LTTNG_UST_EVENT_HT_SIZE - 1)];
                        cds_hlist_for_each_entry(event, node, head, hlist) {
                                if (event->desc == desc
-                                               && event->chan == enabler->chan)
+                                               && event->chan == enabler->chan) {
                                        found = 1;
+                                       break;
+                               }
                        }
                        if (found)
                                continue;
@@ -1126,6 +1128,18 @@ int lttng_attach_context(struct lttng_ust_context *context_param,
                return lttng_add_user_ns_to_ctx(ctx);
        case LTTNG_UST_CONTEXT_UTS_NS:
                return lttng_add_uts_ns_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VUID:
+               return lttng_add_vuid_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VEUID:
+               return lttng_add_veuid_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VSUID:
+               return lttng_add_vsuid_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VGID:
+               return lttng_add_vgid_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VEGID:
+               return lttng_add_vegid_to_ctx(ctx);
+       case LTTNG_UST_CONTEXT_VSGID:
+               return lttng_add_vsgid_to_ctx(ctx);
        default:
                return -EINVAL;
        }
This page took 0.02515 seconds and 4 git commands to generate.