X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=ad181d7c4343b72182269556bf689d593bd21d4d;hp=87231858f96ded25cb05c189b1c0464dc2f09c3f;hb=20fb9e0220fe6ca9d6fd52e4e3e41b898452a8f1;hpb=8490897a08bcb2e38d78ccae01fe00e50f2f8bd8 diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 87231858f..ad181d7c4 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "../command.h" @@ -79,11 +80,13 @@ static int destroy_session(struct lttng_session *session) { int ret; char *session_name = NULL; + bool session_was_stopped; ret = lttng_stop_tracing_no_wait(session->name); if (ret < 0 && ret != -LTTNG_ERR_TRACE_ALREADY_STOPPED) { ERR("%s", lttng_strerror(ret)); } + session_was_stopped = ret == -LTTNG_ERR_TRACE_ALREADY_STOPPED; if (!opt_no_wait) { _MSG("Waiting for data availability"); fflush(stdout); @@ -106,6 +109,13 @@ static int destroy_session(struct lttng_session *session) } while (ret != 0); MSG(""); } + if (!session_was_stopped) { + /* + * Don't print the event and packet loss warnings since the user + * already saw them when stopping the trace. + */ + print_session_stats(session->name); + } ret = lttng_destroy_session_no_wait(session->name); if (ret < 0) {