* SOFTWARE.
*/
+#define BT_LOG_OUTPUT_LEVEL log_level
#define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE"
-#include "logging.h"
+#include "logging/log.h"
#include <glib.h>
#include <inttypes.h>
static
void lttng_live_destroy_trace(struct lttng_live_trace *trace)
{
+ bt_logging_level log_level = trace->log_level;
+
BT_LOGD("Destroy lttng_live_trace");
BT_ASSERT(trace->stream_iterators);
uint64_t trace_id)
{
struct lttng_live_trace *trace = NULL;
+ bt_logging_level log_level = session->log_level;
trace = g_new0(struct lttng_live_trace, 1);
if (!trace) {
goto error;
}
+ trace->log_level = session->log_level;
trace->session = session;
trace->id = trace_id;
trace->trace_class = NULL;
{
int ret = 0;
struct lttng_live_session *session;
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
session = g_new0(struct lttng_live_session, 1);
if (!session) {
goto error;
}
+ session->log_level = lttng_live_msg_iter->log_level;
session->id = session_id;
session->traces = g_ptr_array_new_with_free_func(
(GDestroyNotify) lttng_live_destroy_trace);
void lttng_live_destroy_session(struct lttng_live_session *session)
{
struct lttng_live_component *live_comp;
+ bt_logging_level log_level;
if (!session) {
goto end;
}
+ log_level = session->log_level;
BT_LOGD("Destroy lttng live session");
if (session->id != -1ULL) {
if (lttng_live_detach_session(session)) {
enum lttng_live_iterator_status lttng_live_iterator_next_check_stream_state(
struct lttng_live_stream_iterator *lttng_live_stream)
{
+ bt_logging_level log_level = lttng_live_stream->log_level;
+
switch (lttng_live_stream->state) {
case LTTNG_LIVE_STREAM_QUIESCENT:
case LTTNG_LIVE_STREAM_ACTIVE_DATA:
struct lttng_live_msg_iter *lttng_live_msg_iter,
struct lttng_live_stream_iterator *lttng_live_stream)
{
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
enum lttng_live_iterator_status ret =
LTTNG_LIVE_ITERATOR_STATUS_OK;
struct packet_index index;
const bt_clock_snapshot *clock_snapshot = NULL;
int ret = 0;
bt_message_stream_activity_clock_snapshot_state sa_cs_state;
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
BT_ASSERT(msg);
BT_ASSERT(ts_ns);
enum lttng_live_iterator_status ret = LTTNG_LIVE_ITERATOR_STATUS_OK;
enum bt_msg_iter_status status;
uint64_t session_idx, trace_idx;
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
for (session_idx = 0; session_idx < lttng_live_msg_iter->sessions->len;
session_idx++) {
struct lttng_live_stream_iterator *stream_iter,
bt_message **curr_msg)
{
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
enum lttng_live_iterator_status live_status;
retry:
enum lttng_live_iterator_status stream_iter_status;;
int64_t curr_candidate_msg_ts = INT64_MAX;
uint64_t stream_iter_idx;
+ bt_logging_level log_level = lttng_live_msg_iter->log_level;
BT_ASSERT(live_trace);
BT_ASSERT(live_trace->stream_iterators);
bt_self_component_source_as_self_component(self_comp_src);
struct lttng_live_component *lttng_live;
struct lttng_live_msg_iter *lttng_live_msg_iter;
+ bt_logging_level log_level;
BT_ASSERT(self_msg_it);
lttng_live = bt_self_component_get_data(self_comp);
+ log_level = lttng_live->log_level;
/* There can be only one downstream iterator at the same time. */
BT_ASSERT(!lttng_live->has_msg_iter);
goto end;
}
+ lttng_live_msg_iter->log_level = lttng_live->log_level;
lttng_live_msg_iter->lttng_live_comp = lttng_live;
lttng_live_msg_iter->self_msg_iter = self_msg_it;
static
bt_query_status lttng_live_query_list_sessions(const bt_value *params,
- const bt_value **result)
+ const bt_value **result, bt_logging_level log_level)
{
bt_query_status status = BT_QUERY_STATUS_OK;
const bt_value *url_value = NULL;
bt_query_status lttng_live_query(bt_self_component_class_source *comp_class,
const bt_query_executor *query_exec,
const char *object, const bt_value *params,
- __attribute__((unused)) bt_logging_level log_level,
- const bt_value **result)
+ bt_logging_level log_level, const bt_value **result)
{
bt_query_status status = BT_QUERY_STATUS_OK;
if (strcmp(object, "sessions") == 0) {
- status = lttng_live_query_list_sessions(params, result);
+ status = lttng_live_query_list_sessions(params, result,
+ log_level);
} else {
BT_LOGW("Unknown query object `%s`", object);
status = BT_QUERY_STATUS_INVALID_OBJECT;
return action;
}
-struct lttng_live_component *lttng_live_component_create(const bt_value *params)
+struct lttng_live_component *lttng_live_component_create(const bt_value *params,
+ bt_logging_level log_level)
{
struct lttng_live_component *lttng_live;
const bt_value *value = NULL;
if (!lttng_live) {
goto end;
}
+ lttng_live->log_level = log_level;
lttng_live->max_query_size = MAX_QUERY_SIZE;
lttng_live->has_msg_iter = false;
BT_HIDDEN
bt_self_component_status lttng_live_component_init(
- bt_self_component_source *self_comp,
+ bt_self_component_source *self_comp_src,
const bt_value *params, __attribute__((unused)) void *init_method_data)
{
struct lttng_live_component *lttng_live;
bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK;
+ bt_self_component *self_comp =
+ bt_self_component_source_as_self_component(self_comp_src);
+ bt_logging_level log_level = bt_component_get_logging_level(
+ bt_self_component_as_component(self_comp));
- lttng_live = lttng_live_component_create(params);
+ lttng_live = lttng_live_component_create(params, log_level);
if (!lttng_live) {
ret = BT_SELF_COMPONENT_STATUS_NOMEM;
goto error;
}
- lttng_live->self_comp = self_comp;
+ lttng_live->self_comp = self_comp_src;
if (lttng_live_graph_is_canceled(lttng_live)) {
ret = BT_SELF_COMPONENT_STATUS_END;
goto error;
}
- bt_self_component_set_data(
- bt_self_component_source_as_self_component(self_comp),
- lttng_live);
+ bt_self_component_set_data(self_comp, lttng_live);
goto end;
error: