[lttng-dev] Regarding CtfTmfTrace reader in TMF and LTTng's new trace

Shariyar syed.shariyar at gmail.com
Mon Oct 20 12:15:07 EDT 2014


>

  Yes, it is working in TMF views. The index folders are shown separately
in TMF and contents of the new  trace format are also complete.

I looked at the TmfStateSystemAnalysisModule class, and in particular
StateSystemEventRequest class in it at the end. I understand this class
StateSystemEventRequest but how is this ITmfStateProvider  passed to the
constructor StateSystemEventRequest(ITmfState
 Provider sp). I don't see any direct implementation of ITmfStateProvider
there.

Just to give a bit of context, in my scenario, I am interested in directly
reading traces from the hard disk without using the views in TMF. If there
are many traces in the hard disk, my program reads them one by one, perform
its analysis on them, and closes them. My program would pass the path of
the trace folder to a class implementing trace reader  and would take the
contents (Events) one by one from that class.

Thanks,
Shariyar



Date: Mon, 20 Oct 2014 10:37:26 -0400
> From: Genevi?ve Bastien <gbastien+lttng at versatic.net>
> To: lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] Regarding CtfTmfTrace reader in TMF and
>         LTTng's new trace format
> Message-ID: <54451E26.4090308 at versatic.net>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Shariyar,
>
> 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.
>
> 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.
>
> Genevi?ve
>
>
> On 14-10-17 11:31 AM, Shariyar wrote:
> > Hi,
> >
> > 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).
> >
> >  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?
> >
> > I have also pasted below my current source code to read LTTng traces.
> >
> > /**
> >      * Constructor to initialize the trace
> >      * @param filePath file Name
> >      * @throws TmfTraceException An exception during trace reading
> >      */
> >     public CTFSystemCallIterator(String filePath) throws
> > TmfTraceException {
> >         fTrace = new CtfTmfTrace();
> >         fTrace.initTrace(null, filePath, CtfTmfEvent.class);
> >         fTraceIterator = fTrace.createIterator();
> >     }
> >
> >     /**
> >      * Moves Iterator to the next event, and returns true if the iterator
> >      * can advance or false if the iterator cannot advance
> >      **/
> >     @Override
> >     public boolean advance() {
> >         boolean isAdvance = true;
> >         fSyscall = ""; //$NON-NLS-1$
> >         do {
> >             CtfTmfEvent event = fTraceIterator.getCurrentEvent();
> >             System.out.println(event);
> >             fSyscall = handleSysEntryEvent(event);
> >             isAdvance = fTraceIterator.advance();
> >         } while (fSyscall.isEmpty() && isAdvance);
> >
> >         if (!isAdvance) {
> >             fIsDispose = true;
> >             fTrace.dispose();
> >         }
> >
> >         return isAdvance;
> >
> >     }
> >
> > Thanks,
> > Shariyar
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev at lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.lttng.org/pipermail/lttng-dev/attachments/20141020/d05b31bc/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
> ------------------------------
>
> End of lttng-dev Digest, Vol 78, Issue 22
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20141020/af0aab23/attachment.html>


More information about the lttng-dev mailing list