#include <common/hashtable/hashtable.h>
#include <lttng/rotation.h>
#include <lttng/location.h>
+#include <lttng/lttng-error.h>
#include "snapshot.h"
#include "trace-kernel.h"
*/
struct ltt_session {
char name[NAME_MAX];
+ bool has_auto_generated_name;
char hostname[HOST_NAME_MAX]; /* Local hostname. */
+ time_t creation_time;
struct ltt_kernel_session *kernel_session;
struct ltt_ust_session *ust_session;
struct urcu_ref ref;
* copied into those sessions.
*/
struct consumer_output *consumer;
-
+ /*
+ * Indicates whether or not the user has specified an output directory
+ * or if it was configured using the default configuration.
+ */
+ bool has_user_specified_directory;
/* Did at least ONE start command has been triggered?. */
unsigned int has_been_started:1;
/*
* creation defaults.
*/
unsigned int snapshot_mode;
+ /*
+ * A session that has channels that don't use 'mmap' output can't be
+ * used to capture snapshots. This is set to true whenever a
+ * 'splice' kernel channel is enabled.
+ */
+ bool has_non_mmap_channel;
/*
* Timer set when the session is created for live reading.
*/
*/
struct lttng_condition *rotate_condition;
struct lttng_trigger *rotate_trigger;
+ LTTNG_OPTIONAL(uint64_t) last_trace_chunk_id;
+ struct lttng_trace_chunk *current_trace_chunk;
};
/* Prototypes */
-int session_create(char *name, uid_t uid, gid_t gid);
-
+enum lttng_error_code session_create(const char *name, uid_t uid, gid_t gid,
+ struct ltt_session **out_session);
void session_lock(struct ltt_session *session);
void session_lock_list(void);
int session_trylock_list(void);
int session_reset_rotation_state(struct ltt_session *session,
enum lttng_rotation_state result);
+enum lttng_error_code session_switch_trace_chunk(struct ltt_session *session,
+ const char *session_base_path_override,
+ const char *chunk_name_override);
+int session_set_trace_chunk(struct ltt_session *session,
+ struct lttng_trace_chunk *current_trace_chunk);
+
#endif /* _LTT_SESSION_H */