ust-app: fix bogus double-use of iterator
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 16 Nov 2011 02:48:58 +0000 (21:48 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 16 Nov 2011 02:48:58 +0000 (21:48 -0500)
"yo dawg, I'm using my iterator in my iterator".

;-)

Fixes pretty much all of N event/N channel/N session UST problems.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-sessiond/ust-app.c

index f23fd306b20bfd540861ce76ef33b27b0f4367e8..a30b01dca37ce7515d183430921e79929d66c391 100644 (file)
@@ -479,8 +479,11 @@ static void shadow_copy_channel(struct ust_app_channel *ua_chan,
 
        /* Copy all events from ltt ust channel to ust app channel */
        cds_lfht_for_each_entry(uchan->events, &iter, uevent, node) {
+               struct cds_lfht_iter uiter;
+
                ua_event_node = hashtable_lookup(ua_chan->events,
-                               (void *) uevent->attr.name, strlen(uevent->attr.name), &iter);
+                               (void *) uevent->attr.name, strlen(uevent->attr.name),
+                               &uiter);
                if (ua_event_node == NULL) {
                        DBG2("UST event %s not found on shadow copy channel",
                                        uevent->attr.name);
@@ -516,8 +519,11 @@ static void shadow_copy_session(struct ust_app_session *ua_sess,
        /* Iterate over all channels in global domain. */
        cds_lfht_for_each_entry(usess->domain_global.channels, &iter,
                        uchan, node) {
+               struct cds_lfht_iter uiter;
+
                ua_chan_node = hashtable_lookup(ua_sess->channels,
-                               (void *)uchan->name, strlen(uchan->name), &iter);
+                               (void *)uchan->name, strlen(uchan->name),
+                               &uiter);
                if (ua_chan_node != NULL) {
                        continue;
                }
@@ -1054,6 +1060,8 @@ int ust_app_create_event_all(struct ltt_ust_session *usess,
 
        /* For all registered applications */
        cds_lfht_for_each_entry(ust_app_ht, &iter, app, node) {
+               struct cds_lfht_iter uiter;
+
                /* Create session on the tracer side and add it to app session HT */
                ua_sess = create_ust_app_session(usess, app);
                if (ua_sess == NULL) {
@@ -1062,7 +1070,8 @@ int ust_app_create_event_all(struct ltt_ust_session *usess,
 
                /* Lookup channel in the ust app session */
                ua_chan_node = hashtable_lookup(ua_sess->channels,
-                               (void *)uchan->name, strlen(uchan->name), &iter);
+                               (void *)uchan->name, strlen(uchan->name),
+                               &uiter);
                if (ua_chan_node == NULL) {
                        ERR("Channel %s not found in session uid %d. Skipping",
                                        uchan->name, usess->uid);
This page took 0.027043 seconds and 4 git commands to generate.