X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=f8e96936d172f45ae85ac5a2980f8d2020a95a80;hp=fc744fc027cd376c0004431c6303136914d41254;hb=9b22d135a4586b0c859d3d4c734090a1954930d9;hpb=aa3514e96f12c13f681a81ea275dc51dd63473c8 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index fc744fc02..f8e96936d 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2450,6 +2450,8 @@ static int create_channel_per_uid(struct ust_app *app, /* Create the buffer registry channel object. */ ret = create_buffer_reg_channel(reg_uid->registry, ua_chan, ®_chan); if (ret < 0) { + ERR("Error creating the UST channel \"%s\" registry instance", + ua_chan->name); goto error; } assert(reg_chan); @@ -2461,6 +2463,9 @@ static int create_channel_per_uid(struct ust_app *app, ret = do_consumer_create_channel(usess, ua_sess, ua_chan, app->bits_per_long, reg_uid->registry->reg.ust); if (ret < 0) { + ERR("Error creating UST channel \"%s\" on the consumer daemon", + ua_chan->name); + /* * Let's remove the previously created buffer registry channel so * it's not visible anymore in the session registry. @@ -2477,6 +2482,8 @@ static int create_channel_per_uid(struct ust_app *app, */ ret = setup_buffer_reg_channel(reg_uid->registry, ua_chan, reg_chan); if (ret < 0) { + ERR("Error setting up UST channel \"%s\"", + ua_chan->name); goto error; } @@ -2485,6 +2492,10 @@ static int create_channel_per_uid(struct ust_app *app, /* Send buffers to the application. */ ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan); if (ret < 0) { + /* + * Don't report error to the console, since it may be + * caused by application concurrently exiting. + */ goto error; } @@ -2519,6 +2530,8 @@ static int create_channel_per_pid(struct ust_app *app, /* Create and add a new channel registry to session. */ ret = ust_registry_channel_add(registry, ua_chan->key); if (ret < 0) { + ERR("Error creating the UST channel \"%s\" registry instance", + ua_chan->name); goto error; } @@ -2526,11 +2539,17 @@ static int create_channel_per_pid(struct ust_app *app, ret = do_consumer_create_channel(usess, ua_sess, ua_chan, app->bits_per_long, registry); if (ret < 0) { + ERR("Error creating UST channel \"%s\" on the consumer daemon", + ua_chan->name); goto error; } ret = send_channel_pid_to_ust(app, ua_sess, ua_chan); if (ret < 0) { + /* + * Don't report error to the console, since it may be + * caused by application concurrently exiting. + */ goto error; } @@ -4911,28 +4930,19 @@ void ust_app_destroy(struct ust_app *app) * Return 0 on success or else a negative value. */ int ust_app_snapshot_record(struct ltt_ust_session *usess, - struct snapshot_output *output, int wait, unsigned int nb_streams) + struct snapshot_output *output, int wait, uint64_t max_stream_size) { int ret = 0; unsigned int snapshot_done = 0; struct lttng_ht_iter iter; struct ust_app *app; char pathname[PATH_MAX]; - uint64_t max_stream_size = 0; assert(usess); assert(output); rcu_read_lock(); - /* - * Compute the maximum size of a single stream if a max size is asked by - * the caller. - */ - if (output->max_size > 0 && nb_streams > 0) { - max_stream_size = output->max_size / nb_streams; - } - switch (usess->buffer_type) { case LTTNG_BUFFER_PER_UID: { @@ -4962,30 +4972,16 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, /* Add the UST default trace dir to path. */ cds_lfht_for_each_entry(reg->registry->channels->ht, &iter.iter, reg_chan, node.node) { - - /* - * Make sure the maximum stream size is not lower than the - * subbuffer size or else it's an error since we won't be able to - * snapshot anything. - */ - if (max_stream_size && - reg_chan->subbuf_size > max_stream_size) { - ret = -EINVAL; - DBG3("UST app snapshot record maximum stream size %" PRIu64 - " is smaller than subbuffer size of %zu", - max_stream_size, reg_chan->subbuf_size); - goto error; - } - ret = consumer_snapshot_channel(socket, reg_chan->consumer_key, output, 0, - usess->uid, usess->gid, pathname, wait, + ret = consumer_snapshot_channel(socket, reg_chan->consumer_key, + output, 0, usess->uid, usess->gid, pathname, wait, max_stream_size); if (ret < 0) { goto error; } } - ret = consumer_snapshot_channel(socket, reg->registry->reg.ust->metadata_key, output, - 1, usess->uid, usess->gid, pathname, wait, - max_stream_size); + ret = consumer_snapshot_channel(socket, + reg->registry->reg.ust->metadata_key, output, 1, + usess->uid, usess->gid, pathname, wait, max_stream_size); if (ret < 0) { goto error; } @@ -5027,22 +5023,8 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, cds_lfht_for_each_entry(ua_sess->channels->ht, &chan_iter.iter, ua_chan, node.node) { - /* - * Make sure the maximum stream size is not lower than the - * subbuffer size or else it's an error since we won't be able to - * snapshot anything. - */ - if (max_stream_size && - ua_chan->attr.subbuf_size > max_stream_size) { - ret = -EINVAL; - DBG3("UST app snapshot record maximum stream size %" PRIu64 - " is smaller than subbuffer size of %" PRIu64, - max_stream_size, ua_chan->attr.subbuf_size); - goto error; - } - - ret = consumer_snapshot_channel(socket, ua_chan->key, output, 0, - ua_sess->euid, ua_sess->egid, pathname, wait, + ret = consumer_snapshot_channel(socket, ua_chan->key, output, + 0, ua_sess->euid, ua_sess->egid, pathname, wait, max_stream_size); if (ret < 0) { goto error;