<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Shariyar,<br>
<br>
Can your trace be read all right if you import it in TMF (Trace
Compass) and open it normally in it? Do all events appear in the
events table? There were changes to improve the CTF reading part
recently and somebody reported a bug with traces taken on ARM
where events are not read correctly, but the bug is not due to the
index files.<br>
<br>
If the trace is read correctly by TMF, may I suggest that you use
a TmfEventRequest instead of your own iterator to read the trace
events. This is the preferred way for now, most analysis do that
and you don't have to bother about trace types, iterators, etc.
For an example, see the class TmfStateSystemAnalysisModule, at the
end of the file is the event request class and the build() method
from the class that uses it.<br>
<br>
Geneviève<br>
<br>
<br>
On 14-10-17 11:31 AM, Shariyar wrote:<br>
</div>
<blockquote
cite="mid:CAKQh6pgdd+72wcGNxtCC59bQe5sGJ239fWzDsOsSUb4KToCxhw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I am trying to read the traces generated in the latest
format by LTTng--i.e., a trace having an index folder (with
index files) and the files for every channel. I am reading
these type of traces in my Java program by using the
CtfTmfTrace class that exists in TMF. I have been using this
class and its associated classes (e.g., CtfIterator
and CtfTmfEvent) to successfully read the traces in previous
trace format of LTTng (i.e., the trace with only files for
channels and no index folder/files).</div>
<div><br>
</div>
<div> Now, I cannot read the latest trace format with these
classes. In fact, I am only able to read 10-20 events from the
latest trace format. These events are namely power_cpu_idle,
exit_syscall, and sys_ioctl. Can you kindly tell me which
classes to use to read both kind of trace formats; old ones
and the new ones? </div>
<div><br>
</div>
<div>I have also pasted below my current source code to read
LTTng traces.</div>
<div><br>
</div>
<div>
<div>/**</div>
<div> * Constructor to initialize the trace</div>
<div> * @param filePath file Name</div>
<div> * @throws TmfTraceException An exception during
trace reading</div>
<div> */</div>
<div> public CTFSystemCallIterator(String filePath) throws
TmfTraceException {</div>
<div> fTrace = new CtfTmfTrace();</div>
<div> fTrace.initTrace(null, filePath,
CtfTmfEvent.class);</div>
<div> fTraceIterator = fTrace.createIterator();</div>
<div> }</div>
<div><br>
</div>
<div> /**</div>
<div> * Moves Iterator to the next event, and returns true
if the iterator</div>
<div> * can advance or false if the iterator cannot
advance</div>
<div> **/</div>
<div> @Override</div>
<div> public boolean advance() {</div>
<div> boolean isAdvance = true;</div>
<div> fSyscall = ""; //$NON-NLS-1$</div>
<div> do {</div>
<div> CtfTmfEvent event =
fTraceIterator.getCurrentEvent();</div>
<div> System.out.println(event);</div>
<div> fSyscall = handleSysEntryEvent(event);</div>
<div> isAdvance = fTraceIterator.advance();</div>
<div> } while (fSyscall.isEmpty() &&
isAdvance);</div>
<div><br>
</div>
<div> if (!isAdvance) {</div>
<div> fIsDispose = true;</div>
<div> fTrace.dispose();</div>
<div> }</div>
<div><br>
</div>
<div> return isAdvance;</div>
<div><br>
</div>
<div> }</div>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Shariyar</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lttng-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>