summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9d0b798)
Change-Id: Ie64cef32650dbc62238429b10c30a0c8ffd5dac3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8476
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12391
Tested-by: jenkins <jenkins@lttng.org>
BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_END};
static bt_component_class_query_method_status
BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_END};
static bt_component_class_query_method_status
-lttng_live_query_list_sessions(const bt_value *params, const bt_value **result,
+lttng_live_query_list_sessions(const bt2::ConstMapValue params, const bt_value **result,
const bt2c::Logger& logger)
{
bt_component_class_query_method_status status;
const bt2c::Logger& logger)
{
bt_component_class_query_method_status status;
- const bt_value *url_value = NULL;
const char *url;
live_viewer_connection::UP viewer_connection;
enum lttng_live_viewer_status viewer_status;
enum bt_param_validation_status validation_status;
gchar *validate_error = NULL;
const char *url;
live_viewer_connection::UP viewer_connection;
enum lttng_live_viewer_status viewer_status;
enum bt_param_validation_status validation_status;
gchar *validate_error = NULL;
- validation_status = bt_param_validation_validate(params, list_sessions_params, &validate_error);
+ validation_status =
+ bt_param_validation_validate(params.libObjPtr(), list_sessions_params, &validate_error);
if (validation_status == BT_PARAM_VALIDATION_STATUS_MEMORY_ERROR) {
status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR;
goto error;
if (validation_status == BT_PARAM_VALIDATION_STATUS_MEMORY_ERROR) {
status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR;
goto error;
- url_value = bt_value_map_borrow_entry_value_const(params, URL_PARAM);
- url = bt_value_string_get(url_value);
+ url = params[URL_PARAM]->asString().value();
viewer_status = live_viewer_connection_create(url, true, NULL, logger, viewer_connection);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_status = live_viewer_connection_create(url, true, NULL, logger, viewer_connection);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
}
static bt_component_class_query_method_status
}
static bt_component_class_query_method_status
-lttng_live_query_support_info(const bt_value *params, const bt_value **result,
+lttng_live_query_support_info(const bt2::ConstMapValue params, const bt_value **result,
const bt2c::Logger& logger)
{
bt_component_class_query_method_status status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK;
const bt2c::Logger& logger)
{
bt_component_class_query_method_status status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK;
- const bt_value *input_type_value;
- const bt_value *input_value;
+ bt2::OptionalBorrowedObject<bt2::ConstValue> inputValue;
double weight = 0;
struct bt_common_lttng_live_url_parts parts = {};
bt_common_lttng_live_url_parts_deleter partsDeleter {parts};
double weight = 0;
struct bt_common_lttng_live_url_parts parts = {};
bt_common_lttng_live_url_parts_deleter partsDeleter {parts};
__attribute__((unused)) bt_self_component *self_comp = NULL;
*result = NULL;
__attribute__((unused)) bt_self_component *self_comp = NULL;
*result = NULL;
- input_type_value = bt_value_map_borrow_entry_value_const(params, "type");
- if (!input_type_value) {
+ const auto typeValue = params["type"];
+ if (!typeValue) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "Missing expected `type` parameter.");
goto error;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "Missing expected `type` parameter.");
goto error;
}
- if (!bt_value_is_string(input_type_value)) {
+ if (!typeValue->isString()) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "`type` parameter is not a string value.");
goto error;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "`type` parameter is not a string value.");
goto error;
}
- if (strcmp(bt_value_string_get(input_type_value), "string") != 0) {
+ if (strcmp(typeValue->asString().value(), "string") != 0) {
/* We don't handle file system paths */
goto create_result;
}
/* We don't handle file system paths */
goto create_result;
}
- input_value = bt_value_map_borrow_entry_value_const(params, "input");
- if (!input_value) {
+ inputValue = params["input"];
+ if (!inputValue) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "Missing expected `input` parameter.");
goto error;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "Missing expected `input` parameter.");
goto error;
}
- if (!bt_value_is_string(input_value)) {
+ if (!inputValue->isString()) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "`input` parameter is not a string value.");
goto error;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "`input` parameter is not a string value.");
goto error;
}
- parts = bt_common_parse_lttng_live_url(bt_value_string_get(input_value), NULL, 0);
+ parts = bt_common_parse_lttng_live_url(inputValue->asString().value(), NULL, 0);
if (parts.session_name) {
/*
* Looks pretty much like an LTTng live URL: we got the
if (parts.session_name) {
/*
* Looks pretty much like an LTTng live URL: we got the
bt2c::Logger logger {bt2::SelfComponentClass {comp_class},
bt2::PrivateQueryExecutor {priv_query_exec},
"PLUGIN/SRC.CTF.LTTNG-LIVE/QUERY"};
bt2c::Logger logger {bt2::SelfComponentClass {comp_class},
bt2::PrivateQueryExecutor {priv_query_exec},
"PLUGIN/SRC.CTF.LTTNG-LIVE/QUERY"};
+ const bt2::ConstMapValue paramsObj(params);
if (strcmp(object, "sessions") == 0) {
if (strcmp(object, "sessions") == 0) {
- status = lttng_live_query_list_sessions(params, result, logger);
+ status = lttng_live_query_list_sessions(paramsObj, result, logger);
} else if (strcmp(object, "babeltrace.support-info") == 0) {
} else if (strcmp(object, "babeltrace.support-info") == 0) {
- status = lttng_live_query_support_info(params, result, logger);
+ status = lttng_live_query_support_info(paramsObj, result, logger);
} else {
BT_CPPLOGI_SPEC(logger, "Unknown query object `{}`", object);
status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT;
} else {
BT_CPPLOGI_SPEC(logger, "Unknown query object `{}`", object);
status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT;