X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;fp=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=339a7659e5ae63b00d8547d6ac47656cb81e69a8;hb=2e4e8c2d5207b86e35092e7b6ee3b0d1463138b1;hp=2a61eee064f5af2fa558e73db87f2057fd8eb120;hpb=1c40d25cc62e35f06fec9f6012f8ca042bf9bdbd;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 2a61eee06..339a7659e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -2301,6 +2301,21 @@ int cmd_data_pending(struct ltt_session *session) if (session->enabled) { ret = LTTNG_ERR_SESSION_STARTED; goto error; + } else { + /* + * If stopped, just make sure we've started before else the above call + * will always send that there is data pending. + * + * The consumer assumes that when the data pending command is received, + * the trace has been started before or else no output data is written + * by the streams which is a condition for data pending. So, this is + * *VERY* important that we don't ask the consumer before a start + * trace. + */ + if (!session->started) { + ret = 0; + goto error; + } } if (ksess && ksess->consumer) {