The started flag must be set as soon as possible in the start trace
function since if the start fails, it is still consider started for the
code logic.
Added one test to validate the restart tracing in UST.
Signed-off-by: David Goulet <dgoulet@efficios.com>
goto skip_setup;
}
+ /* Indicate that the session has been started once */
+ ua_sess->started = 1;
+
ret = create_ust_app_metadata(ua_sess, usess->pathname, app);
if (ret < 0) {
goto error_rcu_unlock;
if (ret < 0) {
goto error_rcu_unlock;
}
- ua_sess->started = 1;
skip_setup:
/* This start the UST tracing */
}
PRINT_OK();
+ printf("Restart tracing: ");
+ if ((ret = lttng_start_tracing(session_name)) < 0) {
+ printf("error starting tracing: %s\n", lttng_strerror(ret));
+ goto start_fail;
+ }
+ PRINT_OK();
+
+ sleep(2);
+
+ printf("Stop tracing: ");
+ if ((ret = lttng_stop_tracing(session_name)) < 0) {
+ printf("error stopping tracing: %s\n", lttng_strerror(ret));
+ goto stop_fail;
+ }
+ PRINT_OK();
+
printf("Destroy tracing session: ");
if ((ret = lttng_destroy_session(session_name)) < 0) {
printf("error destroying session: %s\n", lttng_strerror(ret));