Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Error while open a trace programmatically

Hi,

The exception shows that the state system should be queried from -9223372036854775808, to:1695185270809001 with resolution of 1. When checking the code in org.eclipse.tracecompass.statesystem.core.StateSystemUtils.getTimes(StateSystemUtils.java:692), there is a check (to -from) > 0 and I think it overflows and it result becomes negative, hence the exception. 

The startTime seems to be still Long.MIN_VALUE (which is also used for TmfTimestamp.BIG_BANG). Please make sure that the timestamps are valid (e.g. trace.getsta

It looks like the start time is still TmfTimestamp.BIG_BANG. Make sure that the ITmfTrace returns a valid start and end time (trace.getStartTime() and trace.getEndTime()) and each time range is a valid time range. In Trace Compass we often read the first event which sets the start time as below. Try to do that before sending the open signal. 

            /* ensure start time is set */

            final ITmfContext context = fTrace.seekEvent(0);

            fTrace.getNext(context);

            context.dispose();


Regards
Bernd

From: Vinod Appu <vinod.appu@xxxxxxxxxxx>
Sent: September 20, 2023 6:16 AM
To: Bernd Hufmann <bernd.hufmann@xxxxxxxxxxxx>; tracecompass-dev@xxxxxxxxxxx <tracecompass-dev@xxxxxxxxxxx>
Subject: Error while open a trace programmatically
 

Hi,

 

I’m getting following error when I tried to open a trace programmatically. But I can open it using double clicking the file.

Following is the code snippet I’m using.

 

 

Snippet

MyTrace myTrace = new MyTrace();

                                             myTrace.initTrace(null,

                                                                           "C:\\Users\\trace.txt",

                                                                           MyTraceEvent.class);                                                                 

TmfTraceManager.refreshSupplementaryFiles(myTrace);

final TmfTimeRange timeRange = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);

TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, myTrace, null));

 

 

Exception

 

java.lang.IllegalArgumentException: from:-9223372036854775808, to:1695185270809001, resolution:1

               at org.eclipse.tracecompass.statesystem.core.StateSystemUtils.getTimes(StateSystemUtils.java:692)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.BaseDataProviderTimeGraphView.getFetchRowModelParameters(BaseDataProviderTimeGraphView.java:666)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.BaseDataProviderTimeGraphView.zoomEntries(BaseDataProviderTimeGraphView.java:413)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView.zoomEntries(AbstractTimeGraphView.java:805)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.BaseDataProviderTimeGraphView.buildEntryList(BaseDataProviderTimeGraphView.java:268)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView$BuildRunnable.run(AbstractTimeGraphView.java:545)

               at org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView$5.run(AbstractTimeGraphView.java:1939)

               at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

 

 

Please let me know whether I need to take care of something else.

 

~Vinod


Back to the top