uint64_t value;
uint8_t is_set;
} LTTNG_PACKED creation_time;
+ struct {
+ char value[LTTNG_PATH_MAX];
+ } LTTNG_PACKED shm_path;
} LTTNG_PACKED;
using lttng_session_uptr = std::unique_ptr<
#define LTTNG_SESSION_PADDING1 8
+enum lttng_get_session_shm_path_status {
+ LTTNG_GET_SESSION_SHM_PATH_STATUS_OK = 0,
+ LTTNG_GET_SESSION_SHM_PATH_STATUS_UNSET = 1,
+ LTTNG_GET_SESSION_SHM_PATH_STATUS_INVALID_PARAMETER = -1,
+};
+
/*!
@brief
Recording session summary.
*/
LTTNG_EXPORT extern int lttng_set_session_shm_path(const char *session_name, const char *shm_dir);
+/*!
+@brief
+ Gets the shm_path set for the given session.
+
+@param[in] session
+ Pointer to an struct lttng_session return by lttng_list_sessions.
+
+@param[out] shm_path
+ A pointer to the shm_path in the session structure.
+
+@param[out] set
+ True when the session's shm_path has been explicitly changed from the default.
+
+@lt_pre_conn
+@lt_pre_not_null{session}
+@lt_pre_not_null{shm_path}
+@lt_pre_not_null{set}
+*/
+LTTNG_EXPORT extern enum lttng_get_session_shm_path_status
+lttng_get_session_shm_path_override(const struct lttng_session *session, const char **shm_path);
/// @}
#ifdef __cplusplus
sessions[i].live_timer_interval = session->live_timer;
extended[i].creation_time.value = (uint64_t) session->creation_time;
extended[i].creation_time.is_set = 1;
+ strncpy(extended[i].shm_path.value, session->shm_path, LTTNG_PATH_MAX);
i++;
}
}
lttng_event_rule_user_tracepoint_set_name_pattern
lttng_event_set_userspace_probe_location
lttng_get_kernel_tracer_status
+lttng_get_session_shm_path_override
lttng_health_create_consumerd
lttng_health_create_relayd
lttng_health_create_sessiond
return ret;
}
+enum lttng_get_session_shm_path_status
+lttng_get_session_shm_path_override(const lttng_session *session, const char **shm_path)
+{
+ struct lttng_session_extended *extended;
+ if (!session || !shm_path || !session->extended.ptr) {
+ return LTTNG_GET_SESSION_SHM_PATH_STATUS_INVALID_PARAMETER;
+ }
+
+ extended = (lttng_session_extended *) session->extended.ptr;
+ *shm_path = extended->shm_path.value;
+ return strlen(*shm_path) == 0 ? LTTNG_GET_SESSION_SHM_PATH_STATUS_UNSET :
+ LTTNG_GET_SESSION_SHM_PATH_STATUS_OK;
+}
+
int lttng_set_session_shm_path(const char *session_name, const char *shm_path)
{
int ret;