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

Shariyar syed.shariyar at gmail.com
Mon Oct 20 14:01:17 EDT 2014

Hi Genevive,
I have found the sollution. Actually, I have replaced the CtfEvent and
CtfIterator by ITmfEvent and ITmfContext. This allows me to read the both
the latest and old format. The sample code is attached below, in case if
some one comes across the same problem.

Best regards,


*private String fSyscall;    private CtfTmfTrace fTrace;    private
ITmfContext fCtxt;            /**     * 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);        fCtxt=fTrace.seekEvent(0);
//fTraceIterator = fTrace.createIterator(); // don't use CtfIterator
}    /**     * 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$        ITmfEvent event;
do{        if ((event=fTrace.getNext(fCtxt))!=null){            fSyscall =
handleSysEntryEvent(event);//returns the sys call (entry) event
        }else            isAdvance=false;        } while
(fSyscall.isEmpty() && isAdvance==true);                        if
(!isAdvance)             close();                return isAdvance;    }*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20141020/53b9dc61/attachment.html>

More information about the lttng-dev mailing list