From: Jérémie Galarneau Date: Mon, 16 May 2016 05:20:47 +0000 (-0400) Subject: Snapshot warning if there are no events in one of the domains X-Git-Tag: v2.6.3~58 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=033030ea690485abe906554312b1469418490174;p=lttng-tools.git Snapshot warning if there are no events in one of the domains Remove the "no data" check from the UST snapshot code since 1) It would report that no data was recorded in the snapshot even if the kernel tracer had recorded events, 2) The kernel consumer does not seem to report such a condition, making it hard to perform the check without modifying the consumer. The consumer interfaces could be modified to reliably provide this information in the future. However, this warning is not provided in the other tracing modes, making its usefulness questionable. An empty snapshot is still a valid trace and users should not always expect a trace to contain events. Moreover, "warning" that no data was produced implies an error may have occured and is probably as confusing as opening an empty trace to the average user. Fixes #1012 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 24e6d0c00..6779bae67 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3027,9 +3027,6 @@ static int record_ust_snapshot(struct ltt_ust_session *usess, case EINVAL: ret = LTTNG_ERR_INVALID; break; - case ENODATA: - ret = LTTNG_ERR_SNAPSHOT_NODATA; - break; default: ret = LTTNG_ERR_SNAPSHOT_FAIL; break; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index ae85bdb80..e0983b041 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -5318,7 +5318,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]; @@ -5370,7 +5369,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, if (ret < 0) { goto error; } - snapshot_done = 1; } break; } @@ -5423,7 +5421,6 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, if (ret < 0) { goto error; } - snapshot_done = 1; } break; } @@ -5432,15 +5429,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;