diff --git a/ros2profile/ros2profile/data/__init__.py b/ros2profile/ros2profile/data/__init__.py index ee4b279..0eabb48 100644 --- a/ros2profile/ros2profile/data/__init__.py +++ b/ros2profile/ros2profile/data/__init__.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. + from typing import Dict, Any, List, Optional from collections import defaultdict +import importlib import logging import os @@ -147,6 +149,12 @@ def build_graph( and process_subscription_events ): _associate_publish_events_to_subscription_callbacks(ret) + + for name, ep in importlib.metadata.entry_points(group='ros2profile.extend_graph'): + logger.debug(f"Executing custom extension '{name}'.") + extend_graph = ep.load() + extend_graph(ret, event_data) + return ret diff --git a/ros2profile/ros2profile/data/convert/ctf.py b/ros2profile/ros2profile/data/convert/ctf.py index f947b63..92c62b1 100644 --- a/ros2profile/ros2profile/data/convert/ctf.py +++ b/ros2profile/ros2profile/data/convert/ctf.py @@ -91,6 +91,12 @@ } +import importlib + +for field_name, conversion_function in importlib.metadata.entry_points(group='ros2profile.custom_conversion_functions'): + logging.debug("Add custom conversion function for " + field_name) + BT2_CONV_FUNC[field_name] = conversion_function.load() + LTTNG_IGNORE_NAMES = [ "kmem_mm_page_alloc", "kmem_mm_page_free",