stream_iter->log_level = log_level;
stream_iter->self_comp = self_comp;
- trace = lttng_live_borrow_trace(session, ctf_trace_id);
+ trace = lttng_live_session_borrow_or_create_trace_by_id(session, ctf_trace_id);
if (!trace) {
BT_COMP_LOGE_APPEND_CAUSE(self_comp,
"Failed to borrow CTF trace.");
}
static
-struct lttng_live_trace *lttng_live_find_trace(struct lttng_live_session *session,
+struct lttng_live_trace *lttng_live_session_borrow_trace_by_id(struct lttng_live_session *session,
uint64_t trace_id)
{
uint64_t trace_idx;
}
BT_HIDDEN
-struct lttng_live_trace *lttng_live_borrow_trace(
+struct lttng_live_trace *lttng_live_session_borrow_or_create_trace_by_id(
struct lttng_live_session *session, uint64_t trace_id)
{
struct lttng_live_trace *trace;
- trace = lttng_live_find_trace(session, trace_id);
+ trace = lttng_live_session_borrow_trace_by_id(session, trace_id);
if (trace) {
goto end;
}
"session-id=%"PRIu64", session-name=\"%s\"",
session->id, session->session_name->str);
if (session->id != -1ULL) {
- if (lttng_live_detach_session(session)) {
+ if (lttng_live_session_detach(session)) {
if (!lttng_live_graph_is_canceled(
session->lttng_live_msg_iter)) {
/* Old relayd cannot detach sessions. */
if (!session->attached) {
enum lttng_live_viewer_status attach_status =
- lttng_live_attach_session(session,
+ lttng_live_session_attach(session,
lttng_live_msg_iter->self_msg_iter);
if (attach_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
if (lttng_live_graph_is_canceled(lttng_live_msg_iter)) {
}
}
- status = lttng_live_get_new_streams(session,
+ status = lttng_live_session_get_new_streams(session,
lttng_live_msg_iter->self_msg_iter);
if (status != LTTNG_LIVE_ITERATOR_STATUS_OK &&
status != LTTNG_LIVE_ITERATOR_STATUS_END) {
return status;
}
-BT_HIDDEN
-void lttng_live_need_new_streams(struct lttng_live_msg_iter *lttng_live_msg_iter)
-{
- uint64_t session_idx;
-
- for (session_idx = 0; session_idx < lttng_live_msg_iter->sessions->len;
- session_idx++) {
- struct lttng_live_session *session =
- g_ptr_array_index(lttng_live_msg_iter->sessions, session_idx);
- session->new_streams_needed = true;
- }
-}
-
static
void lttng_live_force_new_streams_and_metadata(struct lttng_live_msg_iter *lttng_live_msg_iter)
{
void lttng_live_msg_iter_finalize(bt_self_message_iterator *it);
-enum lttng_live_viewer_status lttng_live_create_viewer_session(
- struct lttng_live_msg_iter *lttng_live_msg_iter);
-
-enum lttng_live_viewer_status lttng_live_attach_session(
+enum lttng_live_viewer_status lttng_live_session_attach(
struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter);
-enum lttng_live_viewer_status lttng_live_detach_session(
+enum lttng_live_viewer_status lttng_live_session_detach(
struct lttng_live_session *session);
-enum lttng_live_iterator_status lttng_live_get_new_streams(
+enum lttng_live_iterator_status lttng_live_session_get_new_streams(
struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter);
+struct lttng_live_trace *lttng_live_session_borrow_or_create_trace_by_id(
+ struct lttng_live_session *session, uint64_t trace_id);
+
int lttng_live_add_session(struct lttng_live_msg_iter *lttng_live_msg_iter,
uint64_t session_id,
const char *hostname,
struct lttng_live_msg_iter *lttng_live_msg_iter,
struct lttng_live_stream_iterator *stream, uint8_t *buf,
uint64_t offset, uint64_t req_len, uint64_t *recv_len);
-void lttng_live_add_stream_iterator(struct lttng_live_msg_iter *lttng_live_msg_iter,
- struct lttng_live_stream_iterator *stream_iter);
-void lttng_live_remove_stream_iterator(struct lttng_live_msg_iter *lttng_live_msg_iter,
- struct lttng_live_stream_iterator *stream_iter);
-
-struct lttng_live_trace *lttng_live_borrow_trace(
- struct lttng_live_session *session, uint64_t trace_id);
-void lttng_live_need_new_streams(struct lttng_live_msg_iter *lttng_live_msg_iter);
bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter);
"Failed to create CTF metadata decoder");
goto error;
}
- trace = lttng_live_borrow_trace(session, ctf_trace_id);
+ trace = lttng_live_session_borrow_or_create_trace_by_id(session,
+ ctf_trace_id);
if (!trace) {
BT_COMP_LOGE_APPEND_CAUSE(self_comp,
"Failed to borrow trace");
static
enum lttng_live_viewer_status lttng_live_connect_viewer(
- struct live_viewer_connection *viewer_connection)
+ struct live_viewer_connection *viewer_connection)
{
struct hostent *host;
struct sockaddr_in server_addr;
}
BT_HIDDEN
-enum lttng_live_viewer_status lttng_live_attach_session(
+enum lttng_live_viewer_status lttng_live_session_attach(
struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter)
{
}
BT_HIDDEN
-enum lttng_live_viewer_status lttng_live_detach_session(
+enum lttng_live_viewer_status lttng_live_session_detach(
struct lttng_live_session *session)
{
struct lttng_viewer_cmd cmd;
pindex->events_discarded = be64toh(lindex->events_discarded);
}
+static
+void lttng_live_need_new_streams(struct lttng_live_msg_iter *lttng_live_msg_iter)
+{
+ uint64_t session_idx;
+
+ for (session_idx = 0; session_idx < lttng_live_msg_iter->sessions->len;
+ session_idx++) {
+ struct lttng_live_session *session =
+ g_ptr_array_index(lttng_live_msg_iter->sessions, session_idx);
+ session->new_streams_needed = true;
+ }
+}
+
BT_HIDDEN
enum lttng_live_iterator_status lttng_live_get_next_index(
struct lttng_live_msg_iter *lttng_live_msg_iter,
* Request new streams for a session.
*/
BT_HIDDEN
-enum lttng_live_iterator_status lttng_live_get_new_streams(
+enum lttng_live_iterator_status lttng_live_session_get_new_streams(
struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter)
{
void live_viewer_connection_destroy(
struct live_viewer_connection *conn);
+enum lttng_live_viewer_status lttng_live_create_viewer_session(
+ struct lttng_live_msg_iter *lttng_live_msg_iter);
+
bt_component_class_query_method_status live_viewer_connection_list_sessions(
struct live_viewer_connection *viewer_connection,
const bt_value **user_result);