DESCRIPTION

Update Grammar and Add support for callsites
A new feature coming in LTTng 2.2

Change-Id: I10d28768ee267001638c7d5c94452e6eb26b311c
Signed-off-by: Ivy Mitchell xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2012-10-25 17:48:02.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/451/ 

-------------------------------------
author: Ivy Mitchell
date: 2012-10-25 17:50:06.000000000

Patch Set 1: I would prefer that you didn't submit this

preliminary patch

-------------------------------------
author: Brenden Conley
date: 2012-10-25 18:08:04.000000000

Patch Set 1: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/451/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2012-10-25 18:51:44.000000000

Patch Set 1: (16 inline comments)

Couple comments, looking good.

For some reason this was fun to review. Thanks!

Line:8, /COMMIT_MSG -> No text on the second line!

Line:47, lttng/org.eclipse.linuxtools.ctf.parser/Grammar/CTFLexer.g -> whitespâce

Line:112, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEvent.java -> Are we sure we want to un-static-ize this? Can't we get the trace from the EventDefinition?

Line:23, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> CtfCallsite maybe?

Line:32, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> ctrl+shift+f plz.  Javadoc is not formatted, missing space before {

Constructor should go after the fields

Line:43, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> "public final" maybe? follows the standard order we use elsewhere

Line:51, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> Are Long's really immutable? I'm quite certain they are, but it'd be safe to make sure.

Line:72, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> you can't downcast to int without checking the values.

compareTo() should return either 0, 1 or -1. In fact, why don't you just use:

return ip.compareTo(o.ip);

Line:80, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/Callsite.java -> you can use '/' and ':' and avoid the NON-NLS annotations. (FileName is a string so we shouldn't get the unexpected integer addition we had at some point ;) )

Line:4, lttng/org.eclipse.linuxtools.ctf.parser/Grammar/regenGrammar.sh -> whitespaces

(too bad gedit doesn't check as well as Eclipse does ;) )

Line:11, lttng/org.eclipse.linuxtools.ctf.parser/src/org/eclipse/linuxtools/ctf/parser/CTFLexer.java -> ugh, here's our pre-compiled file again...

Could you re-add the SuppressWarnings here? Saving it will also fix the whitespace issues.

Line:748, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> I really like the API that was added, it offers many ways of searching the callsites (which the viewer might need in different occasions), but abstracts how it's stored underneath.

Line:162, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> It was not done in this file, but typically you want to use the highest-level interface for declaration, unless you really really need to call the specific methods of HashMap. For example:

private Map<A, B> = new HashMap<A, B>();

private List<A> = new LinkedList<A>();

It allows changing the implementing class only in one place.

Line:803, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> Interesting! but I don't think we should have this in the public API until it's actually needed. They can use getCallsiteCandidates().getFirst() already, it's not really more verbose...

Line:817, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> IndexOOBE is a run-time exception, you don't need to add it to the method signature (I think?)

Line:819, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java -> Why don't you keep the callsites in a TreeMap, indexed by IP?

-------------------------------------
