*/
static void usage(FILE *ofp)
{
- fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION [<OPTIONS>]]\n");
+ fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION [SESSION OPTIONS]]\n");
fprintf(ofp, "\n");
fprintf(ofp, "With no arguments, list available tracing session(s)\n");
fprintf(ofp, "\n");
const char *active_string(int value)
{
switch (value) {
- case 0: return " [inactive]";
- case 1: return " [active]";
+ case 0: return "inactive";
+ case 1: return "active";
case -1: return "";
default: return NULL;
}
}
+static const char *snapshot_string(int value)
+{
+ switch (value) {
+ case 1:
+ return " snapshot";
+ default:
+ return "";
+ }
+}
+
static
const char *enabled_string(int value)
{
MSG("- %s:%s\n", channel->name, enabled_string(channel->enabled));
MSG("%sAttributes:", indent4);
- MSG("%swrite mode: %s", indent6,
- channel->attr.overwrite == 0 ? "discard" : "overwrite");
- MSG("%ssubbufers size: %" PRIu64 " bytes", indent6,
- channel->attr.subbuf_size);
+ MSG("%soverwrite mode: %d", indent6, channel->attr.overwrite);
+ MSG("%ssubbufers size: %" PRIu64, indent6, channel->attr.subbuf_size);
MSG("%snumber of subbufers: %" PRIu64, indent6, channel->attr.num_subbuf);
- MSG("%sswitch timer interval: %u usec", indent6,
- channel->attr.switch_timer_interval);
- MSG("%sread timer interval: %u usec", indent6,
- channel->attr.read_timer_interval);
+ MSG("%sswitch timer interval: %u", indent6, channel->attr.switch_timer_interval);
+ MSG("%sread timer interval: %u", indent6, channel->attr.read_timer_interval);
switch (channel->attr.output) {
case LTTNG_EVENT_SPLICE:
MSG("%soutput: splice()", indent6);
if (session_name != NULL) {
if (strncmp(sessions[i].name, session_name, NAME_MAX) == 0) {
session_found = 1;
- MSG("Tracing session %s:%s", session_name, active_string(sessions[i].enabled));
+ 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);
break;
}
- continue;
- }
-
- MSG(" %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
- active_string(sessions[i].enabled));
-
- if (session_found) {
- break;
+ } else {
+ MSG(" %d) %s (%s) [%s%s]", i + 1, sessions[i].name, sessions[i].path,
+ active_string(sessions[i].enabled),
+ snapshot_string(sessions[i].snapshot_mode));
}
}