[lttng-dev] Reading live traces in eclipse

Matthew Khouzam matthew.khouzam at ericsson.com
Fri Feb 21 15:23:12 EST 2014


Hi All,
I figured I would give a status update to what's going on in eclipe wrt
live trace reading.

We currently had a little push to get it up and running, here is the
result:

Reading CTF while it's live: should work 100%
    reading TSDL fragments and updating the trace: done
    reading streams while they grow: done
    reading streams as they arrive: done

Reading the state system while it's being written: should work 100%
    reading a state system before it's closed: done
    views updating before the state system is closed: done

Connecting to the relayd: prototype is done (github)
    connecting to the relayd: done
    requesting more of the trace: done

Gluing the whole thing together... still needs to be done

For now, if you wish to read live traces for now here's what you can do:

before:

CTFTrace trace = new CTFTrace(tracefile);
CTFTraceReader reader = new CTFTraceReader(trace);
while (reader.advance()) {
    // event stuff goes here
    reader.getCurrentEventDef();
}

Now with live support:

CTFTrace trace = new CTFTrace(tracefile);
CTFTraceReader reader = new CTFTraceReader(trace);
reader.setLive(true);
while (reader.advance() && !reader.isLive()) {
    while (reader.getCurrentEventDef()!= null) {
        Thread.sleep();
        reader.advance();
    }
    // event stuff goes here
    reader.getCurrentEventDef();
}

// probably won't happen that often compared to growing streams
handler hasMoreMetadata(String data){
    Metadata md = new Metadata(trace);
    md.parseTextFragment(data); 
}

// probably won't happen that often compared to growing streams
handler hasMoreStreams(File f) {
    trace.addStreamFile(f);
}


All of this extra work will be internally handled by TMF.



More information about the lttng-dev mailing list