X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=34d4c9b1558de816bd1935ba02eef50b1c90e511;hp=d1fa0d09cb2b04d75b3419cd6fa969a602253eb0;hb=7badf927c6cd5d2e2ef217b905e45d5c3229ae79;hpb=b3bdb105e903c1800da1dbd45109397a07c43ed8 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index d1fa0d09c..34d4c9b15 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4932,6 +4932,7 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, struct snapshot_output *output, int wait, unsigned int nb_streams) { int ret = 0; + unsigned int snapshot_done = 0; struct lttng_ht_iter iter; struct ust_app *app; char pathname[PATH_MAX]; @@ -5006,6 +5007,7 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, if (ret < 0) { goto error; } + snapshot_done = 1; } break; } @@ -5073,6 +5075,7 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, if (ret < 0) { goto error; } + snapshot_done = 1; } break; } @@ -5081,6 +5084,15 @@ 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;