TApplencourt / metababel

YAML to Babeltrace 2 Component "compiler-compiler"
2 stars 2 forks source link

[HIP Support] Stream class does not support packets #102

Closed DonAurelio closed 1 year ago

DonAurelio commented 1 year ago

I am generating a source to create dummy HIP messages. After solving some minor issues I came up with the following error:

09-28 21:44:24.709  8963  8963 F LIB/STREAM-CLASS bt_stream_class_set_packet_context_field_class@stream-class.c:323 Babeltrace 2 library precondition not satisfied; error is:
09-28 21:44:24.709  8963  8963 F LIB/STREAM-CLASS bt_stream_class_set_packet_context_field_class@stream-class.c:323 Stream class does not support packets: sc-addr=0x17b2c00, sc-id=0, sc-name="thapi_hip", sc-is-frozen=0, sc-event-class-count=0, sc-packet-context-fc-addr=(nil), sc-event-common-context-fc-addr=(nil), sc-assigns-auto-ec-id=1, sc-assigns-auto-stream-id=1, sc-supports-packets=0, sc-packets-have-begin-default-cs=0, sc-packets-have-end-default-cs=0, sc-supports-discarded-events=0, sc-discarded-events-have-default-cs=0, sc-supports-discarded-packets=0, sc-discarded-packets-have-default-cs=0, sc-trace-class-addr=0x17c5fe0, sc-pcf-pool-size=0, sc-pcf-pool-cap=0
09-28 21:44:24.709  8963  8963 F LIB/STREAM-CLASS bt_stream_class_set_packet_context_field_class@stream-class.c:323 Aborting...
Aborted

In short Stream class does not support packets.... This came out now since it is the first time we are using the package_context_field in the model.

Seems this is happening because we are not calling bt_stream_class_set_supports_packets() once the stream class is created.

Possible solution:

We should call this function before the line below. https://github.com/TApplencourt/metababel/blob/ac0487b0ebe54a4ba5a8a66e5eabe0bf12bd0860/lib/metababel/bt2_trace_class_generator.rb#L171

TApplencourt commented 1 year ago

Agree, I guess we need to add it only if we have a packet_context_field_class on the model. I think it's the only tine we use packet. We do not yet support anything bt_create_packet and so fort. So just call it inside this if https://github.com/TApplencourt/metababel/blob/ac0487b0ebe54a4ba5a8a66e5eabe0bf12bd0860/lib/metababel/bt2_trace_class_generator.rb#L183