X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace_collection_message_iterator.py;h=097e1c8b6e8b37deb3028183f861809ecf56c7af;hb=0530003ff4f693e0a582a0ed4a15245455398b4a;hp=4e7347a92a01128a6265f4b2328739540d3044c5;hpb=2532cf78d0cd0fec227267685be6cc5383ac7303;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py index 4e7347a9..097e1c8b 100644 --- a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py +++ b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py @@ -76,7 +76,8 @@ class ComponentSpec(_BaseComponentSpec): super().__init__(params, obj, logging_level) is_cc_object = isinstance( - component_class, (bt2._SourceComponentClass, bt2._FilterComponentClass) + component_class, + (bt2._SourceComponentClassConst, bt2._FilterComponentClassConst), ) is_user_cc_type = isinstance( component_class, bt2_component._UserComponentType @@ -345,34 +346,30 @@ class TraceCollectionMessageIterator(bt2_message_iterator._MessageIterator): self._stream_inter_port_to_range = {} for src_comp_and_spec in self._src_comps_and_specs: - try: - inputs = src_comp_and_spec.spec.params['inputs'] - except KeyError as e: - raise ValueError( - 'all source components must be created with an "inputs" parameter in stream intersection mode' - ) from e - - params = {'inputs': inputs} - - # query the port's component for the `babeltrace.trace-info` + # Query the port's component for the `babeltrace.trace-infos` # object which contains the range for each stream, from which we can # compute the intersection of the streams in each trace. query_exec = bt2.QueryExecutor( - src_comp_and_spec.spec.component_class, 'babeltrace.trace-info', params + src_comp_and_spec.spec.component_class, + 'babeltrace.trace-infos', + src_comp_and_spec.spec.params, ) trace_infos = query_exec.query() for trace_info in trace_infos: begin = max( - [stream['range-ns']['begin'] for stream in trace_info['streams']] + [ + stream['range-ns']['begin'] + for stream in trace_info['stream-infos'] + ] ) end = min( - [stream['range-ns']['end'] for stream in trace_info['streams']] + [stream['range-ns']['end'] for stream in trace_info['stream-infos']] ) # Each port associated to this trace will have this computed # range. - for stream in trace_info['streams']: + for stream in trace_info['stream-infos']: # A port name is unique within a component, but not # necessarily across all components. Use a component # and port name pair to make it unique across the graph. @@ -501,7 +498,7 @@ class TraceCollectionMessageIterator(bt2_message_iterator._MessageIterator): if not self._connect_ports: return - if type(port) is bt2_port._InputPort: + if type(port) is bt2_port._InputPortConst: return if component not in [comp.comp for comp in self._src_comps_and_specs]: