X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ftrace_collection_message_iterator.py;h=3003c5f3730f8fdf9e3f4f6b7ba8a75a1e8cc9a2;hp=56b48da9ff8061fe4a96e70870495ec711c313a2;hb=39b351f91e4c70b30530b915d49b74d6004dac42;hpb=829185774639595c2a6324697be5aa016cb03f8a 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 56b48da9..3003c5f3 100644 --- a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py +++ b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py @@ -130,6 +130,8 @@ def _auto_discover_source_component_specs(auto_source_comp_specs, plugin_set): comp_specs_raw = res['results'] assert type(comp_specs_raw) == bt2.ArrayValue + used_input_indices = set() + for comp_spec_raw in comp_specs_raw: assert type(comp_spec_raw) == bt2.ArrayValue assert len(comp_spec_raw) == 4 @@ -171,6 +173,8 @@ def _auto_discover_source_component_specs(auto_source_comp_specs, plugin_set): if orig_spec.obj is not AutoSourceComponentSpec._no_obj: obj = orig_spec.obj + used_input_indices.add(int(idx)) + params['inputs'] = comp_inputs comp_specs.append( @@ -183,6 +187,17 @@ def _auto_discover_source_component_specs(auto_source_comp_specs, plugin_set): ) ) + if len(used_input_indices) != len(inputs): + unused_input_indices = set(range(len(inputs))) - used_input_indices + unused_input_indices = sorted(unused_input_indices) + unused_inputs = [str(inputs[x]) for x in unused_input_indices] + + msg = ( + 'Some auto source component specs did not produce any component: ' + + ', '.join(unused_inputs) + ) + raise RuntimeError(msg) + return comp_specs