[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] CTF trace reader: ordering events in multiple streams with same timestamp

Hi Phyo,

If you look at patch https://git.eclipse.org/r/139675, the tie-breaker when timestamps are equal is the stream filename alphabetical order. It does not guarantee creation order, but at least it guarantees a predictable order.

To have some other order I think would involve:

- add custom extra attribute to the trace event, and add ability in CTF parser for the user to provide a custom tie-breaking comparator

- define some standard tie-breaking extra attribute in CTF events that would apply for all, and update CTF parser with a corresponding tie-breaking comparator

We can investigate if any of these solutions are possible.

In the meantime, just an idea, you might be able to do something in your trace by using a different clock frequency? For example if the CTF timestamps are in picoseconds maybe you can use the last 3 digits as some kind of sequence number? Then to prevent timestamp overflow you can set a clock offset in the trace metadata.

Patrick



On Tue, Jul 9, 2019 at 9:19 AM Phyo Kyaw <phyokyaw.uk@xxxxxxxxx> wrote:
Dear all,

We have generated CTF trace file with multiple streams for each core and in some cases CTF events can have same timestamp during to sampling rate faster than clock speed. In this case the order seems to be what ever created first and assigned reader.

Generated
Event in stream file 1:Â Â 001 Core 0 Started work
Event in stream file 2:Â Â 001 Core 1 Completed work

Read back
001 Core 1ÂCompletedÂwork
001 Core 0 Started work


Looks likeÂCTFTraceReader() hasÂStreamInputReaderTimestampComparator() which is a bit inflexible to extend or modify.

Any suggestions to make it shown as written. I understand no other information to order them but we can add extra attribute during creation to set the order.

Thanks
Phyo
_______________________________________________
tracecompass-dev mailing list
tracecompass-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tracecompass-dev