<div dir="ltr">Using the Babletrace Python binding version 1.3, I adapted a simple example to try to write a trace with two streams.  It appears to write okay (no errors), but when I attempt to read it back (again using Babeltrace) I get an error:<div><br></div><div><div>[error] Stream 1 is not declared in metadata.</div><div>[error] Stream index creation error.</div><div>[error] Open file stream error.</div><div>[warning] [Context] Cannot open_trace of format ctf at path ./trace.</div></div><div><br></div><div>Here is my code to write the streams:</div><div><br></div><div>################################</div><div><br></div><div>from babeltrace import *</div><div><br></div><div>trace_path = "./trace"</div><div><br></div><div>print('trace path: {}'.format(trace_path))</div><div><br></div><div>writer = CTFWriter.Writer(trace_path)</div><div><br></div><div>clock = CTFWriter.Clock('my_clock')</div><div>clock.description = 'this is my clock'</div><div>writer.add_clock(clock)</div><div><br></div><div>stream_class = CTFWriter.StreamClass('my_stream')</div><div>stream_class.clock = clock</div><div><br></div><div>event_class = CTFWriter.EventClass('my_event')</div><div><br></div><div>int32_field_decl = CTFWriter.IntegerFieldDeclaration(32)</div><div>int32_field_decl.signed = True</div><div><br></div><div>event_class.add_field(int32_field_decl, 'my_field')</div><div><br></div><div>stream_class.add_event_class(event_class)</div><div><br></div><div>stream = writer.create_stream(stream_class)</div><div>stream2 = writer.create_stream(stream_class)</div><div><br></div><div>event = CTFWriter.Event(event_class)</div><div>event.payload('my_field').value = -23</div><div>stream.append_event(event)</div><div><br></div><div>event = CTFWriter.Event(event_class)</div><div>event.payload('my_field').value = -89</div><div>stream.append_event(event)</div><div><br></div><div>event = CTFWriter.Event(event_class)</div><div>event.payload('my_field').value = -849</div><div>stream2.append_event(event)</div><div><br></div><div>event = CTFWriter.Event(event_class)</div><div>event.payload('my_field').value = 42</div><div>stream2.append_event(event)</div><div><br></div><div>stream.flush()</div><div>stream2.flush() </div><div><br></div><div>######################</div><div><br></div><div>I am sure I am just not quite using the API correctly.  If you can spot the error, please let me know.  Also, if anyone can point me to an example of using the python bindings to write out multiple streams, I would appreciate it.</div><div><br></div><div>Thanks!</div><div>Rocky</div></div>