Iterate events in one packet
Quoted 5 lines · * Yao Qi ([email protected]) wrote:
Hi,
When I generate CTF, I logically group events and put them into one packet. When reading the CTF data (w/ libbabeltrace), can I iterate over events in one packet (and stop when iterator goes to the next packet)?
I'm curious to see what you are trying to achieve by grouping events this way ?
You know you could simply put each logical event group into a different "channel" within the same trace, right ?
The level of abstraction at which the babeltrace iterator presents the trace does not expose details about packet switching. I'd need more information to understand the value of your use-case.
Thanks,
Mathieu
Quoted 61 lines
For example,
stream { packet.context := struct { uint32_t content_size; uint32_t packet_size; }; event.header := struct { uint32_t id; }; };event { name = "tsv"; id = 1; fields := struct { uint64_t val; uint32_t num; }; };event { name = "register"; id = 0; fields := struct { uint8_t contents[440]; }; };we have multiple events and put them into different packets according to my logic,
packet 1: tsv1, register1,
packet 2: tsv2, tsv3, register2from iterator's point of view, packet boundary is invisible and iterator will go through them like "tsv1, register1, tsv2, tsv3, register2". In order to identify the boundary of packet in the iterator, I have to create a event "marker" and put it at the first event of one packet.
event { name = "marker"; id = 2; fields := struct { }; };packet 1: marker1, tsv1, register1,
packet 2: marker2, tsv2, tsv3, register2We'll stop the iteration once we see "marker" event. It works for me, but I am wondering we can solve this problem in a better way?
Signature · 6 lines
Yao (齐尧) _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 8 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Quoted 2 lines · Mathieu Desnoyers
I'm curious to see what you are trying to achieve by grouping events this way ?
We propose to GDB community to save GDB trace data into CTF and read CTF data saved by GDB (via libbabeltrace).
[PATCH 0/5, 2nd try] CTF Support
http://sourceware.org/ml/gdb-patches/2013-02/msg00669.html
The GDB trace data is composed by several trace frames, and each trace frame is composed by several blocks. When saving GDB trace data into CTF, we save the block as ctf event, and save these events belong to the same trace frame into one packet, so that the information of the trace frame can be saved into packet context.
When reading CTF data, usually we will look for events in current trace frame (packet), so that I am asking this question, to see if it is easier to do iteration in one packet.
Quoted 3 lines
You know you could simply put each logical event group into a different "channel" within the same trace, right ?
Can you elaborate a little please? I am quite new to CTF and babeltrace.
Quoted 4 lines
The level of abstraction at which the babeltrace iterator presents the trace does not expose details about packet switching. I'd need more information to understand the value of your use-case.
Hope my description above is clear.
Signature · 6 lines
Yao (齐尧) _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Quoted 16 lines · * Yao Qi ([email protected]) wrote:
Quoted 2 lines · Mathieu Desnoyers
I'm curious to see what you are trying to achieve by grouping events this way ?
We propose to GDB community to save GDB trace data into CTF and read CTF data saved by GDB (via libbabeltrace).
[PATCH 0/5, 2nd try] CTF Support
http://sourceware.org/ml/gdb-patches/2013-02/msg00669.htmlThe GDB trace data is composed by several trace frames, and each trace frame is composed by several blocks. When saving GDB trace data into CTF, we save the block as ctf event, and save these events belong to the same trace frame into one packet, so that the information of the trace frame can be saved into packet context.
Quoted 3 lines
When reading CTF data, usually we will look for events in current trace frame (packet), so that I am asking this question, to see if it is easier to do iteration in one packet.
You might want to consider an alternative design:
consider this mapping instead:
one event = one trace frame
the event "payload" would be a sequence of blocks.
Each block can contain its own information. You could use the "variant" type if you need different types for each block within a trace frame.
This would fit more nicely with CTF.
Thanks,
Mathieu
Quoted 16 lines
Quoted 4 lines
You know you could simply put each logical event group into a different "channel" within the same trace, right ?
Can you elaborate a little please? I am quite new to CTF and babeltrace.
Quoted 4 lines
The level of abstraction at which the babeltrace iterator presents the trace does not expose details about packet switching. I'd need more information to understand the value of your use-case.
Hope my description above is clear.
Signature · 1 line
Yao (齐尧)
Signature · 8 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev