Clean-up: remove unnecessary blank line
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 9b634facc1422630827e5e92268839ef37b20146..1bb183d5c68dfe7d4e5d56125f1dfbac26492a3a 100644 (file)
@@ -551,7 +551,7 @@ ssize_t ust_app_push_metadata(struct ust_registry_session *registry,
        char *metadata_str = NULL;
        size_t len, offset, new_metadata_len_sent;
        ssize_t ret_val;
-       uint64_t metadata_key;
+       uint64_t metadata_key, metadata_version;
 
        assert(registry);
        assert(socket);
@@ -581,6 +581,7 @@ ssize_t ust_app_push_metadata(struct ust_registry_session *registry,
        offset = registry->metadata_len_sent;
        len = registry->metadata_len - registry->metadata_len_sent;
        new_metadata_len_sent = registry->metadata_len;
+       metadata_version = registry->metadata_version;
        if (len == 0) {
                DBG3("No metadata to push for metadata key %" PRIu64,
                                registry->metadata_key);
@@ -617,7 +618,7 @@ push_data:
         * different bidirectionnal communication sockets.
         */
        ret = consumer_push_metadata(socket, metadata_key,
-                       metadata_str, len, offset);
+                       metadata_str, len, offset, metadata_version);
        pthread_mutex_lock(&registry->lock);
        if (ret < 0) {
                /*
@@ -5725,7 +5726,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess,
                uint64_t nb_packets_per_stream)
 {
        int ret = 0;
-       unsigned int snapshot_done = 0;
        struct lttng_ht_iter iter;
        struct ust_app *app;
        char pathname[PATH_MAX];
@@ -5777,7 +5777,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess,
                        if (ret < 0) {
                                goto error;
                        }
-                       snapshot_done = 1;
                }
                break;
        }
@@ -5830,7 +5829,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess,
                        if (ret < 0) {
                                goto error;
                        }
-                       snapshot_done = 1;
                }
                break;
        }
@@ -5839,15 +5837,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess,
                break;
        }
 
-       if (!snapshot_done) {
-               /*
-                * If no snapshot was made and we are not in the error path, this means
-                * that there are no buffers thus no (prior) application to snapshot
-                * data from so we have simply NO data.
-                */
-               ret = -ENODATA;
-       }
-
 error:
        rcu_read_unlock();
        return ret;
@@ -5944,9 +5933,11 @@ int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id,
        if (overwrite) {
                ret = consumer_get_lost_packets(ust_session_id,
                                consumer_chan_key, consumer, lost);
+               *discarded = 0;
        } else {
                ret = consumer_get_discarded_events(ust_session_id,
                                consumer_chan_key, consumer, discarded);
+               *lost = 0;
        }
 
 end:
@@ -5989,10 +5980,12 @@ int ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess,
                if (overwrite) {
                        ret = consumer_get_lost_packets(usess->id, ua_chan->key,
                                        consumer, lost);
+                       *discarded = 0;
                        goto end;
                } else {
                        ret = consumer_get_discarded_events(usess->id,
                                        ua_chan->key, consumer, discarded);
+                       *lost = 0;
                        goto end;
                }
        }
This page took 0.02483 seconds and 4 git commands to generate.