#include <assert.h>
#include <common/mi-lttng.h>
+#include <common/time.h>
#include <lttng/constant.h>
#include "../command.h"
}
if (value) {
- MSG("%" PRId64 " µs", value);
+ MSG("%" PRId64 " %s", value, USEC_UNIT);
} else {
MSG("inactive");
}
if (blocking_timeout == -1) {
MSG("%sBlocking timeout: infinite", indent6);
} else {
- MSG("%sBlocking timeout: %" PRId64 " µs", indent6, blocking_timeout);
+ MSG("%sBlocking timeout: %" PRId64 " %s", indent6,
+ blocking_timeout, USEC_UNIT);
}
}
goto end;
}
- MSG(" timer period: %" PRIu64" µs", value);
+ MSG(" timer period: %" PRIu64" %s", value, USEC_UNIT);
ret = CMD_SUCCESS;
end:
return ret;
int ret = CMD_SUCCESS;
int count, i;
unsigned int session_found = 0;
- struct lttng_session *sessions;
+ struct lttng_session *sessions = NULL;
count = lttng_list_sessions(&sessions);
DBG("Session count %d", count);
if (lttng_opt_mi) {
/* Mi */
if (session_name == NULL) {
- /* List all session */
+ /* List all sessions */
ret = mi_list_sessions(sessions, count);
} else {
/* Note : this return an open session element */
}
if (ret) {
ret = CMD_ERROR;
- goto error;
+ goto end;
}
} else {
/* Pretty print */
MSG("Available tracing sessions:");
}
-
for (i = 0; i < count; i++) {
if (session_name != NULL) {
if (strncmp(sessions[i].name, session_name, NAME_MAX) == 0) {
MSG("Tracing session %s: [%s%s]", session_name,
active_string(sessions[i].enabled),
snapshot_string(sessions[i].snapshot_mode));
- MSG("%sTrace path: %s\n", indent4, sessions[i].path);
+ if (*sessions[i].path) {
+ MSG("%sTrace output: %s\n", indent4, sessions[i].path);
+ }
memcpy(&listed_session, &sessions[i],
sizeof(listed_session));
break;
}
} else {
- MSG(" %d) %s (%s) [%s%s]", i + 1,
- sessions[i].name, sessions[i].path,
+ MSG(" %d) %s [%s%s]", i + 1,
+ sessions[i].name,
active_string(sessions[i].enabled),
snapshot_string(sessions[i].snapshot_mode));
- MSG("%sTrace path: %s", indent4, sessions[i].path);
+ if (*sessions[i].path) {
+ MSG("%sTrace output: %s", indent4, sessions[i].path);
+ }
if (sessions[i].live_timer_interval != 0) {
- MSG("%sLive timer interval: %u µs", indent4,
- sessions[i].live_timer_interval);
+ MSG("%sLive timer interval: %u %s", indent4,
+ sessions[i].live_timer_interval,
+ USEC_UNIT);
}
MSG("");
}
if (!session_found && session_name != NULL) {
ERR("Session '%s' not found", session_name);
ret = CMD_ERROR;
- goto error;
+ goto end;
}
if (session_name == NULL) {
}
}
-error:
- free(sessions);
end:
+ free(sessions);
return ret;
}