diff --git a/src/test/infra/lttng/test_lttng.py b/src/test/infra/lttng/test_lttng.py index 77be2c6c2..6bfd84657 100644 --- a/src/test/infra/lttng/test_lttng.py +++ b/src/test/infra/lttng/test_lttng.py @@ -30,6 +30,8 @@ from caret_analyze.value_objects import ExecutorValue from caret_analyze.value_objects.node import NodeValue +import os + import pytest @@ -318,8 +320,22 @@ def test_singleton_disabled(self, mocker): def test_compare_init_event(self): init_events = [] event_collection = {} - # for testing sorting with _timestamp + + ros_version = os.environ['ROS_DISTRO'] TIME_ORDER = 0 + SORT_ORDER_ADD_IRON = 4 + if ros_version == 'jazzy': + SORT_ORDER_ADD_JAZZY = 10 + SORT_ORDER = 12 + SMALL_ORDER = 50 + RESULT_ORDER_ADD_JAZZY = 34 + RESULT_ORDER = 36 + else: + SORT_ORDER = 10 + SMALL_ORDER = 48 + RESULT_ORDER = 34 + + # for testing sorting with _timestamp event_collection[TIME_ORDER+0] = { '_name': 'ros2_caret:rclcpp_callback_register', '_timestamp': 503, } event_collection[TIME_ORDER+1] = { @@ -331,7 +347,6 @@ def test_compare_init_event(self): # below, _timestamp is the same # the order of _prioritized_init_events is defined in reverse order # (lowest priority first) - SORT_ORDER_ADD_IRON = 4 event_collection[SORT_ORDER_ADD_IRON+0] = { '_name': 'ros2:rclcpp_ipb_to_subscription', '_timestamp': 600, } event_collection[SORT_ORDER_ADD_IRON+1] = { @@ -344,7 +359,14 @@ def test_compare_init_event(self): '_name': 'ros2:rclcpp_construct_ring_buffer', '_timestamp': 600, } event_collection[SORT_ORDER_ADD_IRON+5] = { '_name': 'ros2_caret:rclcpp_construct_ring_buffer', '_timestamp': 600, } - SORT_ORDER = 10 + + if ros_version == 'jazzy': + event_collection[SORT_ORDER_ADD_JAZZY+0] = { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', \ + '_timestamp': 600, } + event_collection[SORT_ORDER_ADD_JAZZY+1] = { + '_name': 'ros2_caret:executor_entity_collector_to_executor', '_timestamp': 600, } + event_collection[SORT_ORDER+0] = { '_name': 'ros2_caret:callback_group_add_client', '_timestamp': 600, } event_collection[SORT_ORDER+1] = { @@ -422,7 +444,6 @@ def test_compare_init_event(self): event_collection[SORT_ORDER+37] = { '_name': 'ros2_caret:rcl_init', '_timestamp': 600, } # also check when _timestamp is small - SMALL_ORDER = 48 event_collection[SMALL_ORDER+0] = { '_name': 'ros2_caret:callback_group_add_client', '_timestamp': 400, } event_collection[SMALL_ORDER+1] = { @@ -506,40 +527,50 @@ def test_compare_init_event(self): init_events[32]['_name'] == 'ros2_caret:caret_init' assert init_events[33]['_timestamp'] == 600 and \ init_events[33]['_name'] == 'ros2_caret:rmw_implementation' - assert init_events[34]['_timestamp'] == 600 and \ - init_events[34]['_name'] == 'ros2_caret:construct_executor' - assert init_events[35]['_timestamp'] == 600 and \ - init_events[35]['_name'] == 'ros2_caret:construct_static_executor' - assert init_events[36]['_timestamp'] == 600 and \ - init_events[36]['_name'] == 'ros2_caret:add_callback_group' - assert init_events[37]['_timestamp'] == 600 and \ - init_events[37]['_name'] == 'ros2_caret:add_callback_group_static_executor' - assert init_events[38]['_timestamp'] == 600 and \ - init_events[38]['_name'] == 'ros2_caret:callback_group_add_timer' - assert init_events[39]['_timestamp'] == 400 and \ - init_events[39]['_name'] == 'ros2_caret:callback_group_add_subscription' - assert init_events[40]['_timestamp'] == 600 and \ - init_events[40]['_name'] == 'ros2_caret:callback_group_add_subscription' - assert init_events[41]['_timestamp'] == 400 and \ - init_events[41]['_name'] == 'ros2_caret:callback_group_add_service' - assert init_events[42]['_timestamp'] == 600 and \ - init_events[42]['_name'] == 'ros2_caret:callback_group_add_service' - assert init_events[43]['_timestamp'] == 400 and \ - init_events[43]['_name'] == 'ros2_caret:callback_group_add_client' - assert init_events[44]['_timestamp'] == 600 and \ - init_events[44]['_name'] == 'ros2_caret:callback_group_add_client' - assert init_events[45]['_timestamp'] == 600 and \ - init_events[45]['_name'] == 'ros2_caret:rclcpp_construct_ring_buffer' - assert init_events[46]['_timestamp'] == 600 and \ - init_events[46]['_name'] == 'ros2:rclcpp_construct_ring_buffer' - assert init_events[47]['_timestamp'] == 600 and \ - init_events[47]['_name'] == 'ros2_caret:rclcpp_buffer_to_ipb' - assert init_events[48]['_timestamp'] == 600 and \ - init_events[48]['_name'] == 'ros2:rclcpp_buffer_to_ipb' - assert init_events[49]['_timestamp'] == 600 and \ - init_events[49]['_name'] == 'ros2_caret:rclcpp_ipb_to_subscription' - assert init_events[50]['_timestamp'] == 600 and \ - init_events[50]['_name'] == 'ros2:rclcpp_ipb_to_subscription' + + if ros_version == 'jazzy': + assert init_events[RESULT_ORDER_ADD_JAZZY+0]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER_ADD_JAZZY+0]['_name'] == \ + 'ros2_caret:callback_group_to_executor_entity_collector' + assert init_events[RESULT_ORDER_ADD_JAZZY+1]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER_ADD_JAZZY+1]['_name'] == \ + 'ros2_caret:executor_entity_collector_to_executor' + + assert init_events[RESULT_ORDER+0]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+0]['_name'] == 'ros2_caret:construct_executor' + assert init_events[RESULT_ORDER+1]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+1]['_name'] == 'ros2_caret:construct_static_executor' + assert init_events[RESULT_ORDER+2]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+2]['_name'] == 'ros2_caret:add_callback_group' + assert init_events[RESULT_ORDER+3]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+3]['_name'] == \ + 'ros2_caret:add_callback_group_static_executor' + assert init_events[RESULT_ORDER+4]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+4]['_name'] == 'ros2_caret:callback_group_add_timer' + assert init_events[RESULT_ORDER+5]['_timestamp'] == 400 and \ + init_events[RESULT_ORDER+5]['_name'] == 'ros2_caret:callback_group_add_subscription' + assert init_events[RESULT_ORDER+6]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+6]['_name'] == 'ros2_caret:callback_group_add_subscription' + assert init_events[RESULT_ORDER+7]['_timestamp'] == 400 and \ + init_events[RESULT_ORDER+7]['_name'] == 'ros2_caret:callback_group_add_service' + assert init_events[RESULT_ORDER+8]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+8]['_name'] == 'ros2_caret:callback_group_add_service' + assert init_events[RESULT_ORDER+9]['_timestamp'] == 400 and \ + init_events[RESULT_ORDER+9]['_name'] == 'ros2_caret:callback_group_add_client' + assert init_events[RESULT_ORDER+10]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+10]['_name'] == 'ros2_caret:callback_group_add_client' + assert init_events[RESULT_ORDER+11]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+11]['_name'] == 'ros2_caret:rclcpp_construct_ring_buffer' + assert init_events[RESULT_ORDER+12]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+12]['_name'] == 'ros2:rclcpp_construct_ring_buffer' + assert init_events[RESULT_ORDER+13]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+13]['_name'] == 'ros2_caret:rclcpp_buffer_to_ipb' + assert init_events[RESULT_ORDER+14]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+14]['_name'] == 'ros2:rclcpp_buffer_to_ipb' + assert init_events[RESULT_ORDER+15]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+15]['_name'] == 'ros2_caret:rclcpp_ipb_to_subscription' + assert init_events[RESULT_ORDER+16]['_timestamp'] == 600 and \ + init_events[RESULT_ORDER+16]['_name'] == 'ros2:rclcpp_ipb_to_subscription' def test_duplicated_events_contexts(self, mocker): HDL_CONTEXT = 1000101 @@ -1217,6 +1248,50 @@ def test_duplicated_events_caret_init(self, mocker): # ['rmw_impl'] assert lttng.data.rmw_impl.df.iloc[0]['rmw_impl'] == 10 + def test_duplicated_events_entities_collector(self, mocker): + EXECUTOR_CALLBACK = 1001261 + HDL_EXECUTOR_ENTITIY = 1000701 + VTID1 = 500001 + VPID1 = 600001 + + ros_version = os.environ['ROS_DISTRO'] + if ros_version == 'jazzy': + events = [ + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101101, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101105, + '_vtid': VTID1, + '_vpid': VPID1 + }, + ] + + lttng = Lttng(events, event_filters=[], validate=False) + + # executors + # ['timestamp', 'callback_group_addr', 'callback_group_collection_addr'] + assert lttng.data.callback_group_to_executor_entity_collector.df.index \ + [0] == HDL_EXECUTOR_ENTITIY and \ + lttng.data.callback_group_to_executor_entity_collector.df.iloc \ + [0]['timestamp'] == 100101101 and \ + lttng.data.callback_group_to_executor_entity_collector.df.iloc \ + [0]['callback_group_addr'] == EXECUTOR_CALLBACK + + assert lttng.data.callback_group_to_executor_entity_collector.df.index[1] == 1 and \ + lttng.data.callback_group_to_executor_entity_collector.df.iloc \ + [1]['timestamp'] == 100101105 and \ + lttng.data.callback_group_to_executor_entity_collector.df.iloc \ + [1]['callback_group_addr'] == 1 + def test_duplicated_events_executors(self, mocker): HDL_EXECUTOR = 1001101 HDL_EXECUTOR_STATIC = 1001201 @@ -1224,76 +1299,133 @@ def test_duplicated_events_executors(self, mocker): VTID1 = 500001 VPID1 = 600001 - events = [ - # Initialization trace points - { - '_name': 'ros2_caret:construct_executor', - 'executor_addr': HDL_EXECUTOR, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101101, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_executor', - 'executor_addr': HDL_EXECUTOR, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101103, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101102, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101203, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101205, - '_vtid': VTID1, - '_vpid': VPID1 - }, - ] - - lttng = Lttng(events, event_filters=[], validate=False) - - # executors - # ['timestamp', 'executor_type_name'] - assert lttng.data.executors.df.index[0] == HDL_EXECUTOR and \ - lttng.data.executors.df.iloc[0]['timestamp'] == 100101101 - - assert lttng.data.executors.df.index[1] == 1 and \ - lttng.data.executors.df.iloc[1]['timestamp'] == 100101103 - - # executors_static - # ['timestamp', 'entities_collector_addr', 'executor_type_name'] - assert lttng.data.executors_static.df.index[0] == HDL_EXECUTOR_STATIC and \ - lttng.data.executors_static.df.iloc[0]['timestamp'] == 100101102 and \ - lttng.data.executors_static.df.iloc[0]['entities_collector_addr'] == HDL_ENTITIES - - assert lttng.data.executors_static.df.index[1] == 2 and \ - lttng.data.executors_static.df.iloc[1]['timestamp'] == 100101203 and \ - lttng.data.executors_static.df.iloc[1]['entities_collector_addr'] == 1 - - assert lttng.data.executors_static.df.index[2] == 3 and \ - lttng.data.executors_static.df.iloc[2]['timestamp'] == 100101205 and \ - lttng.data.executors_static.df.iloc[2]['entities_collector_addr'] == 2 + ros_version = os.environ['ROS_DISTRO'] + if ros_version == 'jazzy': + EXECUTOR_CALLBACK = 1001261 + HDL_EXECUTOR_ENTITIY = 1000701 + + events = [ + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101101, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101105, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:executor_entity_collector_to_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + '_timestamp': 100101102, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:executor_entity_collector_to_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + '_timestamp': 100101261, + '_vtid': VTID1, + '_vpid': VPID1 + }, + ] + + lttng = Lttng(events, event_filters=[], validate=False) + + # executors + # ['timestamp', 'executor_entities_collector_addr'] + assert lttng.data.executor_entity_collector_to_executor.df.index \ + [0] == HDL_EXECUTOR and \ + lttng.data.executor_entity_collector_to_executor.df.iloc \ + [0]['timestamp'] == 100101102 and \ + lttng.data.executor_entity_collector_to_executor.df.iloc \ + [0]['executor_entities_collector_addr'] == HDL_EXECUTOR_ENTITIY + + assert lttng.data.executor_entity_collector_to_executor.df.index[1] == 1 and \ + lttng.data.executor_entity_collector_to_executor.df.iloc \ + [1]['timestamp'] == 100101261 and \ + lttng.data.executor_entity_collector_to_executor.df.iloc \ + [1]['executor_entities_collector_addr'] == 1 + else: + events = [ + # Initialization trace points + { + '_name': 'ros2_caret:construct_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101101, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101103, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR_STATIC, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101102, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR_STATIC, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101203, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR_STATIC, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101205, + '_vtid': VTID1, + '_vpid': VPID1 + }, + ] + + lttng = Lttng(events, event_filters=[], validate=False) + + # executors + # ['timestamp', 'executor_type_name'] + assert lttng.data.executors.df.index[0] == HDL_EXECUTOR and \ + lttng.data.executors.df.iloc[0]['timestamp'] == 100101101 + + assert lttng.data.executors.df.index[1] == 1 and \ + lttng.data.executors.df.iloc[1]['timestamp'] == 100101103 + + # executors_static + # ['timestamp', 'entities_collector_addr', 'executor_type_name'] + assert lttng.data.executors_static.df.index[0] == HDL_EXECUTOR_STATIC and \ + lttng.data.executors_static.df.iloc[0]['timestamp'] == 100101102 and \ + lttng.data.executors_static.df.iloc[0]['entities_collector_addr'] == HDL_ENTITIES + + assert lttng.data.executors_static.df.index[1] == 2 and \ + lttng.data.executors_static.df.iloc[1]['timestamp'] == 100101203 and \ + lttng.data.executors_static.df.iloc[1]['entities_collector_addr'] == 1 + + assert lttng.data.executors_static.df.index[2] == 3 and \ + lttng.data.executors_static.df.iloc[2]['timestamp'] == 100101205 and \ + lttng.data.executors_static.df.iloc[2]['entities_collector_addr'] == 2 def test_duplicated_events_callback_groups(self, mocker): HDL_NODE = 1000201 @@ -1314,297 +1446,632 @@ def test_duplicated_events_callback_groups(self, mocker): VTID1 = 500001 VPID1 = 600001 - events = [ - # Initialization trace points - { - '_name': 'ros2:rcl_node_init', - 'node_handle': HDL_NODE, - 'rmw_handle': HDL_RMW, - 'node_name': 'my_node_name', - 'namespace': '/', - '_timestamp': 100100201, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_node_init', - 'node_handle': HDL_NODE, - 'rmw_handle': HDL_RMW, - 'node_name': 'my_node_name', - 'namespace': '/', - '_timestamp': 100100203, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_subscription_init', - 'subscription_handle': HDL_SUBSCRIPTION, - 'node_handle': HDL_NODE, - 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, - '_timestamp': 100101202, - 'topic_name': 'my_topic_name', - 'queue_depth': 1, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_subscription_init', - 'subscription_handle': HDL_SUBSCRIPTION, - 'node_handle': HDL_NODE, - 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, - '_timestamp': 100102403, - 'topic_name': 'my_topic_name', - 'queue_depth': 1, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_subscription_init', - 'subscription_handle': HDL_SUBSCRIPTION, - 'node_handle': HDL_NODE, - 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, - '_timestamp': 100103404, - 'topic_name': 'my_topic_name', - 'queue_depth': 1, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_timer_init', - 'timer_handle': HDL_TIMER, - 'period': 100, - '_timestamp': 100100701, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_timer_init', - 'timer_handle': HDL_TIMER, - 'period': 101, - '_timestamp': 100100703, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_service_init', - 'service_handle': HDL_SERVICE, - 'node_handle': HDL_NODE, - 'rmw_service_handle': HDL_RMW_SERVICE, - '_timestamp': 100100202, - 'service_name': 'my_service_name', - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_service_init', - 'service_handle': HDL_SERVICE, - 'node_handle': HDL_NODE, - 'rmw_service_handle': HDL_RMW_SERVICE, - '_timestamp': 100100212, - 'service_name': 'my_service_name', - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_client_init', - 'client_handle': HDL_CLIENT, - 'node_handle': HDL_NODE, - 'rmw_client_handle': HDL_RMW_CLIENT, - '_timestamp': 100100202, - 'service_name': 'my_service_name', - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rcl_client_init', - 'client_handle': HDL_CLIENT, - 'node_handle': HDL_NODE, - 'rmw_client_handle': HDL_RMW_CLIENT, - '_timestamp': 100100602, - 'service_name': 'my_service_name', - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rclcpp_service_callback_added', - 'service_handle': HDL_SERVICE, - 'callback': SERVICE_CALLBACK, - '_timestamp': 100100205, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2:rclcpp_service_callback_added', - 'service_handle': HDL_SERVICE, - 'callback': SERVICE_CALLBACK, - '_timestamp': 100100221, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_executor', - 'executor_addr': HDL_EXECUTOR, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101101, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_executor', - 'executor_addr': HDL_EXECUTOR, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101103, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101102, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101203, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:construct_static_executor', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'entities_collector_addr': HDL_ENTITIES, - 'executor_type_name': 'my_executor_name', - '_timestamp': 100101205, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:add_callback_group', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'callback_group_addr': EXECUTOR_CALLBACK, - 'group_type_name': 'my_group_name', - '_timestamp': 100101102, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:add_callback_group', - 'executor_addr': HDL_EXECUTOR_STATIC, - 'callback_group_addr': EXECUTOR_CALLBACK, - 'group_type_name': 'my_group_name', - '_timestamp': 100101261, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:add_callback_group_static_executor', - 'entities_collector_addr': HDL_ENTITIES, - 'callback_group_addr': EXECUTOR_STA_CALLBACK, - 'group_type_name': 'my_group_name', - '_timestamp': 100101204, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:add_callback_group_static_executor', - 'entities_collector_addr': HDL_ENTITIES, - 'callback_group_addr': EXECUTOR_STA_CALLBACK, - 'group_type_name': 'my_group_name', - '_timestamp': 100101281, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_timer', - 'timer_handle': HDL_TIMER, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100100702, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_timer', - 'timer_handle': HDL_TIMER, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100101302, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_subscription', - 'subscription_handle': HDL_SUBSCRIPTION, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100100401, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_subscription', - 'subscription_handle': HDL_SUBSCRIPTION, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100102402, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_service', - 'service_handle': HDL_SERVICE, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100100201, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_service', - 'service_handle': HDL_SERVICE, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100101502, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_client', - 'client_handle': HDL_CLIENT, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100100201, - '_vtid': VTID1, - '_vpid': VPID1 - }, - { - '_name': 'ros2_caret:callback_group_add_client', - 'client_handle': HDL_CLIENT, - 'callback_group_addr': EXECUTOR_CALLBACK, - '_timestamp': 100101602, - '_vtid': VTID1, - '_vpid': VPID1 - }, - ] + ros_version = os.environ['ROS_DISTRO'] + if ros_version == 'jazzy': + HDL_EXECUTOR_ENTITIY = 1000701 + events = [ + # Initialization trace points + { + '_name': 'ros2:rcl_node_init', + 'node_handle': HDL_NODE, + 'rmw_handle': HDL_RMW, + 'node_name': 'my_node_name', + 'namespace': '/', + '_timestamp': 100100201, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_node_init', + 'node_handle': HDL_NODE, + 'rmw_handle': HDL_RMW, + 'node_name': 'my_node_name', + 'namespace': '/', + '_timestamp': 100100203, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_subscription_init', + 'subscription_handle': HDL_SUBSCRIPTION, + 'node_handle': HDL_NODE, + 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, + '_timestamp': 100101202, + 'topic_name': 'my_topic_name', + 'queue_depth': 1, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_subscription_init', + 'subscription_handle': HDL_SUBSCRIPTION, + 'node_handle': HDL_NODE, + 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, + '_timestamp': 100102403, + 'topic_name': 'my_topic_name', + 'queue_depth': 1, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_subscription_init', + 'subscription_handle': HDL_SUBSCRIPTION, + 'node_handle': HDL_NODE, + 'rmw_subscription_handle': HDL_RMW_SUBSCRIPTION, + '_timestamp': 100103404, + 'topic_name': 'my_topic_name', + 'queue_depth': 1, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_timer_init', + 'timer_handle': HDL_TIMER, + 'period': 100, + '_timestamp': 100100701, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_timer_init', + 'timer_handle': HDL_TIMER, + 'period': 101, + '_timestamp': 100100703, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_service_init', + 'service_handle': HDL_SERVICE, + 'node_handle': HDL_NODE, + 'rmw_service_handle': HDL_RMW_SERVICE, + '_timestamp': 100100202, + 'service_name': 'my_service_name', + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_service_init', + 'service_handle': HDL_SERVICE, + 'node_handle': HDL_NODE, + 'rmw_service_handle': HDL_RMW_SERVICE, + '_timestamp': 100100212, + 'service_name': 'my_service_name', + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_client_init', + 'client_handle': HDL_CLIENT, + 'node_handle': HDL_NODE, + 'rmw_client_handle': HDL_RMW_CLIENT, + '_timestamp': 100100202, + 'service_name': 'my_service_name', + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rcl_client_init', + 'client_handle': HDL_CLIENT, + 'node_handle': HDL_NODE, + 'rmw_client_handle': HDL_RMW_CLIENT, + '_timestamp': 100100602, + 'service_name': 'my_service_name', + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rclcpp_service_callback_added', + 'service_handle': HDL_SERVICE, + 'callback': SERVICE_CALLBACK, + '_timestamp': 100100205, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2:rclcpp_service_callback_added', + 'service_handle': HDL_SERVICE, + 'callback': SERVICE_CALLBACK, + '_timestamp': 100100221, + '_vtid': VTID1, + '_vpid': VPID1 + }, + # ################ + # JAZZY added> + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101101, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:callback_group_to_executor_entity_collector', + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + 'callback_group_addr': EXECUTOR_CALLBACK, + '_timestamp': 100101105, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:executor_entity_collector_to_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + '_timestamp': 100101102, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:executor_entity_collector_to_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_entities_collector_addr': HDL_EXECUTOR_ENTITIY, + '_timestamp': 100101261, + '_vtid': VTID1, + '_vpid': VPID1 + }, + # + { + '_name': 'ros2_caret:construct_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101112, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_executor', + 'executor_addr': HDL_EXECUTOR, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101213, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101122, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101203, + '_vtid': VTID1, + '_vpid': VPID1 + }, + { + '_name': 'ros2_caret:construct_static_executor', + 'executor_addr': HDL_EXECUTOR, + 'entities_collector_addr': HDL_ENTITIES, + 'executor_type_name': 'my_executor_name', + '_timestamp': 100101205, + '_vtid': VTID1, + '_vpid': VPID1 + }, + # + # { + # '_name': 'ros2_caret:add_callback_group', + # 'executor_addr': HDL_EXECUTOR_STATIC, + # 'callback_group_addr': EXECUTOR_CALLBACK, + # 'group_type_name': 'my_group_name', + # '_timestamp': 100101102, + # '_vtid': VTID1, + # '_vpid': VPID1 + # }, + # { + # '_name': 'ros2_caret:add_callback_group', + # 'executor_addr': HDL_EXECUTOR_STATIC, + # 'callback_group_addr': EXECUTOR_CALLBACK, + # 'group_type_name': 'my_group_name', + # '_timestamp': 100101261, + # '_vtid': VTID1, + # '_vpid': VPID1 + # }, + # { + # '_name': 'ros2_caret:add_callback_group_static_executor', + # 'entities_collector_addr': HDL_ENTITIES, + # 'callback_group_addr': EXECUTOR_STA_CALLBACK, + # 'group_type_name': 'my_group_name', + # '_timestamp': 100101204, + # '_vtid': VTID1, + # '_vpid': VPID1 + # }, + # { + # '_name': 'ros2_caret:add_callback_group_static_executor', + # 'entities_collector_addr': HDL_ENTITIES, + # 'callback_group_addr': EXECUTOR_STA_CALLBACK, + # 'group_type_name': 'my_group_name', + # '_timestamp': 100101281, + # '_vtid': VTID1, + # '_vpid': VPID1 + # }, + #