summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9c8a504)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib4280e02ef7520fdca0dc4718ae36d5e34ae56ca
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1470
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
+#define BT_COMP_LOG_SELF_COMP (trimmer_comp->self_comp)
#define BT_LOG_OUTPUT_LEVEL (trimmer_comp->log_level)
#define BT_LOG_TAG "PLUGIN/FLT.UTILS.TRIMMER"
#define BT_LOG_OUTPUT_LEVEL (trimmer_comp->log_level)
#define BT_LOG_TAG "PLUGIN/FLT.UTILS.TRIMMER"
-#include "logging/log.h"
+#include "plugins/comp-logging.h"
#include "compat/utc.h"
#include "compat/time.h"
#include "compat/utc.h"
#include "compat/time.h"
struct trimmer_bound begin, end;
bool is_gmt;
bt_logging_level log_level;
struct trimmer_bound begin, end;
bool is_gmt;
bt_logging_level log_level;
+ bt_self_component *self_comp;
};
enum trimmer_iterator_state {
};
enum trimmer_iterator_state {
- BT_LOGE("Invalid date/time format: param=\"%s\"", str);
+ BT_COMP_LOGE("Invalid date/time format: param=\"%s\"", str);
} else if (bt_value_is_string(param)) {
arg = bt_value_string_get(param);
} else {
} else if (bt_value_is_string(param)) {
arg = bt_value_string_get(param);
} else {
- BT_LOGE("`%s` parameter must be an integer or a string value.",
+ BT_COMP_LOGE("`%s` parameter must be an integer or a string value.",
param_name);
ret = -1;
goto end;
param_name);
ret = -1;
goto end;
if (!begin->is_infinite && !end->is_infinite &&
begin->ns_from_origin > end->ns_from_origin) {
if (!begin->is_infinite && !end->is_infinite &&
begin->ns_from_origin > end->ns_from_origin) {
- BT_LOGE("Trimming time range's beginning time is greater than end time: "
+ BT_COMP_LOGE("Trimming time range's beginning time is greater than end time: "
"begin-ns-from-origin=%" PRId64 ", "
"end-ns-from-origin=%" PRId64,
begin->ns_from_origin,
"begin-ns-from-origin=%" PRId64 ", "
"end-ns-from-origin=%" PRId64,
begin->ns_from_origin,
}
if (!begin->is_infinite && begin->ns_from_origin == INT64_MIN) {
}
if (!begin->is_infinite && begin->ns_from_origin == INT64_MIN) {
- BT_LOGE("Invalid trimming time range's beginning time: "
+ BT_COMP_LOGE("Invalid trimming time range's beginning time: "
"ns-from-origin=%" PRId64,
begin->ns_from_origin);
ret = -1;
"ns-from-origin=%" PRId64,
begin->ns_from_origin);
ret = -1;
}
if (!end->is_infinite && end->ns_from_origin == INT64_MIN) {
}
if (!end->is_infinite && end->ns_from_origin == INT64_MIN) {
- BT_LOGE("Invalid trimming time range's end time: "
+ BT_COMP_LOGE("Invalid trimming time range's end time: "
"ns-from-origin=%" PRId64,
end->ns_from_origin);
ret = -1;
"ns-from-origin=%" PRId64,
end->ns_from_origin);
ret = -1;
-bt_self_component_status trimmer_init(bt_self_component_filter *self_comp,
+bt_self_component_status trimmer_init(bt_self_component_filter *self_comp_flt,
const bt_value *params, void *init_data)
{
int ret;
bt_self_component_status status;
struct trimmer_comp *trimmer_comp = create_trimmer_comp();
const bt_value *params, void *init_data)
{
int ret;
bt_self_component_status status;
struct trimmer_comp *trimmer_comp = create_trimmer_comp();
+ bt_self_component *self_comp =
+ bt_self_component_filter_as_self_component(self_comp_flt);
if (!trimmer_comp) {
status = BT_SELF_COMPONENT_STATUS_NOMEM;
goto error;
}
trimmer_comp->log_level = bt_component_get_logging_level(
if (!trimmer_comp) {
status = BT_SELF_COMPONENT_STATUS_NOMEM;
goto error;
}
trimmer_comp->log_level = bt_component_get_logging_level(
- bt_self_component_as_component(
- bt_self_component_filter_as_self_component(self_comp)));
+ bt_self_component_as_component(self_comp));
+ trimmer_comp->self_comp = self_comp;
status = bt_self_component_filter_add_input_port(
status = bt_self_component_filter_add_input_port(
- self_comp, in_port_name, NULL, NULL);
+ self_comp_flt, in_port_name, NULL, NULL);
if (status != BT_SELF_COMPONENT_STATUS_OK) {
goto error;
}
status = bt_self_component_filter_add_output_port(
if (status != BT_SELF_COMPONENT_STATUS_OK) {
goto error;
}
status = bt_self_component_filter_add_output_port(
- self_comp, "out", NULL, NULL);
+ self_comp_flt, "out", NULL, NULL);
if (status != BT_SELF_COMPONENT_STATUS_OK) {
goto error;
}
if (status != BT_SELF_COMPONENT_STATUS_OK) {
goto error;
}
- bt_self_component_set_data(
- bt_self_component_filter_as_self_component(self_comp),
- trimmer_comp);
+ bt_self_component_set_data(self_comp, trimmer_comp);
- BT_LOGE_ERRNO("Cannot convert timestamp to date and time",
+ BT_COMP_LOGE_ERRNO("Cannot convert timestamp to date and time",
"ts=%" PRId64, (int64_t) time_seconds);
ret = -1;
goto end;
"ts=%" PRId64, (int64_t) time_seconds);
ret = -1;
goto end;
if (trimmer_it->begin.is_infinite) {
if (!bt_self_component_port_input_message_iterator_can_seek_beginning(
trimmer_it->upstream_iter)) {
if (trimmer_it->begin.is_infinite) {
if (!bt_self_component_port_input_message_iterator_can_seek_beginning(
trimmer_it->upstream_iter)) {
- BT_LOGE_STR("Cannot make upstream message iterator initially seek its beginning.");
+ BT_COMP_LOGE_STR("Cannot make upstream message iterator initially seek its beginning.");
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
goto end;
}
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
goto end;
}
if (!bt_self_component_port_input_message_iterator_can_seek_ns_from_origin(
trimmer_it->upstream_iter,
trimmer_it->begin.ns_from_origin)) {
if (!bt_self_component_port_input_message_iterator_can_seek_ns_from_origin(
trimmer_it->upstream_iter,
trimmer_it->begin.ns_from_origin)) {
- BT_LOGE("Cannot make upstream message iterator initially seek: "
+ BT_COMP_LOGE("Cannot make upstream message iterator initially seek: "
"seek-ns-from-origin=%" PRId64,
trimmer_it->begin.ns_from_origin);
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
"seek-ns-from-origin=%" PRId64,
trimmer_it->begin.ns_from_origin);
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
*/
sc = bt_stream_borrow_class_const(stream);
if (!bt_stream_class_borrow_default_clock_class_const(sc)) {
*/
sc = bt_stream_borrow_class_const(stream);
if (!bt_stream_class_borrow_default_clock_class_const(sc)) {
- BT_LOGE("Unsupported stream: stream class does "
+ BT_COMP_LOGE("Unsupported stream: stream class does "
"not have a default clock class: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
"not have a default clock class: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
*/
if (!bt_stream_class_packets_have_beginning_default_clock_snapshot(
sc)) {
*/
if (!bt_stream_class_packets_have_beginning_default_clock_snapshot(
sc)) {
- BT_LOGE("Unsupported stream: packets have "
+ BT_COMP_LOGE("Unsupported stream: packets have "
"no beginning clock snapshot: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
"no beginning clock snapshot: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
if (!bt_stream_class_packets_have_end_default_clock_snapshot(
sc)) {
if (!bt_stream_class_packets_have_end_default_clock_snapshot(
sc)) {
- BT_LOGE("Unsupported stream: packets have "
+ BT_COMP_LOGE("Unsupported stream: packets have "
"no end clock snapshot: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
"no end clock snapshot: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
if (bt_stream_class_supports_discarded_events(sc) &&
!bt_stream_class_discarded_events_have_default_clock_snapshots(sc)) {
if (bt_stream_class_supports_discarded_events(sc) &&
!bt_stream_class_discarded_events_have_default_clock_snapshots(sc)) {
- BT_LOGE("Unsupported stream: discarded events "
+ BT_COMP_LOGE("Unsupported stream: discarded events "
"have no clock snapshots: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
"have no clock snapshots: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
if (bt_stream_class_supports_discarded_packets(sc) &&
!bt_stream_class_discarded_packets_have_default_clock_snapshots(sc)) {
if (bt_stream_class_supports_discarded_packets(sc) &&
!bt_stream_class_discarded_packets_have_default_clock_snapshots(sc)) {
- BT_LOGE("Unsupported stream: discarded packets "
+ BT_COMP_LOGE("Unsupported stream: discarded packets "
"have no clock snapshots: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "
"have no clock snapshots: "
"stream-addr=%p, "
"stream-id=%" PRIu64 ", "