Skip to content

Commit

Permalink
lib: remove self component param. from msg. iterator init. method
Browse files Browse the repository at this point in the history
Since a3f0c7d ("lib: introduce bt_message_iterator_class"), the
`self_component` parameter of
`bt_message_iterator_class_initialize_method` is useless because you can
access the equivalent with bt_self_message_iterator_borrow_component().

Remove it.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I81e967acfd99b6ef3a2e01ae2ee19008a3c60408
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2761
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
  • Loading branch information
eepp authored and jgalar committed Jan 20, 2020
1 parent 246d522 commit e1b15e5
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 19 deletions.
1 change: 0 additions & 1 deletion include/babeltrace2/graph/message-iterator-class.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ typedef bt_message_iterator_class_initialize_method_status
(*bt_message_iterator_class_initialize_method)(
bt_self_message_iterator *message_iterator,
bt_self_message_iterator_configuration *config,
bt_self_component *self_component,
bt_self_component_port_output *port);

typedef void
Expand Down
4 changes: 3 additions & 1 deletion src/bindings/python/bt2/bt2/native_bt_component_class.i.h
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,6 @@ bt_message_iterator_class_initialize_method_status
component_class_message_iterator_init(
bt_self_message_iterator *self_message_iterator,
bt_self_message_iterator_configuration *config,
bt_self_component *self_component,
bt_self_component_port_output *self_component_port_output)
{
bt_message_iterator_class_initialize_method_status status = __BT_FUNC_STATUS_OK;
Expand All @@ -1095,6 +1094,9 @@ component_class_message_iterator_init(
PyObject *py_init_method_result = NULL;
PyObject *py_iter = NULL;
PyObject *py_comp;
bt_self_component *self_component =
bt_self_message_iterator_borrow_component(
self_message_iterator);
bt_logging_level log_level = get_self_component_log_level(
self_component);

Expand Down
1 change: 0 additions & 1 deletion src/lib/graph/iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ int create_self_component_input_port_message_iterator(
iter_status = init_method(
(struct bt_self_message_iterator *) iterator,
&iterator->config,
(struct bt_self_component *) upstream_comp,
(struct bt_self_component_port_output *) upstream_port);
BT_LOGD("User method returned: status=%s",
bt_common_func_status_string(iter_status));
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/ctf/fs-src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,15 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status ctf_fs_iterator_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
struct ctf_fs_port_data *port_data;
struct ctf_fs_msg_iter_data *msg_iter_data = NULL;
bt_message_iterator_class_initialize_method_status status;
bt_logging_level log_level;
enum ctf_msg_iter_medium_status medium_status;
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_iter);

port_data = bt_self_component_port_get_data(
bt_self_component_port_output_as_self_component_port(
Expand Down
1 change: 0 additions & 1 deletion src/plugins/ctf/fs-src/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status ctf_fs_iterator_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port);

BT_HIDDEN
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/ctf/lttng-live/lttng-live.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,16 +1567,15 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status lttng_live_msg_iter_init(
bt_self_message_iterator *self_msg_it,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
bt_message_iterator_class_initialize_method_status status;
struct lttng_live_component *lttng_live;
struct lttng_live_msg_iter *lttng_live_msg_iter;
enum lttng_live_viewer_status viewer_status;
bt_logging_level log_level;

BT_ASSERT(self_msg_it);
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_it);

lttng_live = bt_self_component_get_data(self_comp);
log_level = lttng_live->log_level;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/ctf/lttng-live/lttng-live.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ bt_message_iterator_class_next_method_status lttng_live_msg_iter_next(
bt_message_iterator_class_initialize_method_status lttng_live_msg_iter_init(
bt_self_message_iterator *self_msg_it,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port);

void lttng_live_msg_iter_finalize(bt_self_message_iterator *it);
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/lttng-utils/debug-info/debug-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
bt_message_iterator_class_initialize_method_status status;
Expand All @@ -1995,6 +1994,8 @@ bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init(
struct debug_info_msg_iter *debug_info_msg_iter = NULL;
gchar *debug_info_field_name;
int ret;
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_iter);
bt_logging_level log_level = bt_component_get_logging_level(
bt_self_component_as_component(self_comp));

Expand Down
1 change: 0 additions & 1 deletion src/plugins/lttng-utils/debug-info/debug-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port);

BT_HIDDEN
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/text/dmesg/dmesg.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,10 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status dmesg_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_iter);
struct dmesg_component *dmesg_comp = bt_self_component_get_data(self_comp);
struct dmesg_msg_iter *dmesg_msg_iter =
g_new0(struct dmesg_msg_iter, 1);
Expand Down
1 change: 0 additions & 1 deletion src/plugins/text/dmesg/dmesg.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status dmesg_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port);

BT_HIDDEN
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/utils/muxer/muxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,12 +1276,13 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status muxer_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *port)
{
struct muxer_comp *muxer_comp = NULL;
struct muxer_msg_iter *muxer_msg_iter = NULL;
bt_message_iterator_class_initialize_method_status status;
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_iter);

muxer_comp = bt_self_component_get_data(self_comp);
BT_ASSERT(muxer_comp);
Expand Down
1 change: 0 additions & 1 deletion src/plugins/utils/muxer/muxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status muxer_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port);

BT_HIDDEN
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/utils/trimmer/trimmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,14 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status trimmer_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *port)
{
bt_message_iterator_class_initialize_method_status status;
bt_message_iterator_create_from_message_iterator_status
msg_iter_status;
struct trimmer_iterator *trimmer_it;
bt_self_component *self_comp =
bt_self_message_iterator_borrow_component(self_msg_iter);

trimmer_it = g_new0(struct trimmer_iterator, 1);
if (!trimmer_it) {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/utils/trimmer/trimmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ BT_HIDDEN
bt_message_iterator_class_initialize_method_status trimmer_msg_iter_init(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *port);

BT_HIDDEN
Expand Down
2 changes: 0 additions & 2 deletions tests/lib/test-plugin-plugins/sfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static bt_message_iterator_class_initialize_method_status
src_dummy_iterator_init_method(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK;
Expand All @@ -38,7 +37,6 @@ static bt_message_iterator_class_initialize_method_status
flt_dummy_iterator_init_method(
bt_self_message_iterator *self_msg_iter,
bt_self_message_iterator_configuration *config,
bt_self_component *self_comp,
bt_self_component_port_output *self_port)
{
return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK;
Expand Down

0 comments on commit e1b15e5

Please sign in to comment.