*
* The structures should be initialized to zero before use.
*/
-#define LTTNG_SESSION_PADDING1 16
+#define LTTNG_SESSION_PADDING1 12
struct lttng_session {
char name[NAME_MAX];
/* The path where traces are written */
char path[PATH_MAX];
uint32_t enabled; /* enabled/started: 1, disabled/stopped: 0 */
+ uint32_t snapshot_mode;
char padding[LTTNG_SESSION_PADDING1];
};
strncpy(sessions[i].name, session->name, NAME_MAX);
sessions[i].name[NAME_MAX - 1] = '\0';
sessions[i].enabled = session->enabled;
+ sessions[i].snapshot_mode = session->snapshot_mode;
i++;
}
}
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)
{
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;
}
} else {
- MSG(" %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
- active_string(sessions[i].enabled));
+ 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));
}
}