DESCRIPTION

Tmf: Add analysis module for memory usage with UST libc wrapper

An analysis builds a state system for the memory used per thread in a UST
trace with libc events enabled.

It is based on a draft by Ivy Mitchell.

Change-Id: I18566e0eb6cd87103571f17ce88006b6edc53fd5
Signed-off-by: Ivy Mitchell xxx@xxx.xxx
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-01-14 20:28:38.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2014-01-14 20:28:45.000000000

Patch Set 5:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5033/

-------------------------------------
author: Brenden Conley
date: 2014-01-14 21:12:43.000000000

Patch Set 5: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5033/ : FAILURE

-------------------------------------
author: Braxton Mccarthy
date: 2014-01-14 23:53:46.000000000

Patch Set 5:

(15 comments)

Re-triggered the build.

Some more comments, sorry for not catching everything the first time. Now with smaller patches we can look at each one more closely ;)

Line:40, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> maybe add a javadoc comment indicating what each Long is

Line:42, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> Use Long.valueOf() to instantiate Long objects (this is valid for all Number subclasses). valueOf has a cache of often-used values, so you can save on object allocations. Which cannot happen with new Long().

ZERO seems to be used often, but MINUS_ONE not that much, perhaps it's not needed

Line:58, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> switch-on-strings, oh yeah baby!

Line:60, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> each one of those method is not very long, I'd think in-lining them in here would improve readability. You can use {brackets} under each case to restrict the scope (a bit like is done in the LttngKernelProvider)

Line:95, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> This would be better as a private static final define, with a comment "update this if you change the contents".

Line:109, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> return "";

Line:116, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> it'd be a tad more readable as ptr.equals(ZERO). Applies to others below.

Line:117, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> you can do return;, and remove the else

applies to others below

Line:145, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> missing space before =

Line:187, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> Why not just use -memSize ?

Line:192, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> You can use tid.toString() with a Long.

Line:202, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> update comment to say 'others'

Line:204, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> tid.equals(MINUS_ONE)

Line:45, lttng/org.eclipse.linuxtools.lttng2.ust.ui/src/org/eclipse/linuxtools/lttng2/ust/ui/analysis/memory/UstMemoryAnalysisModule.java -> protected can be on the same line

Line:17, lttng/org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF -> Should be aligned with the package name in lttng2.ust.core. And "memory" sounds better than memoryusage, imo.

Also, if this one is public, the other could be too.

-------------------------------------
author: Braxton Mccarthy
date: 2014-01-14 23:53:58.000000000

Patch Set 5: Code-Review-1

-------------------------------------
author: Braxton Mccarthy
date: 2014-01-15 00:00:26.000000000

Patch Set 5:

(1 comment)

Line:17, lttng/org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF -> Also, the view in the following patch could go in the same package. (you should drop analysis from the name though)

-------------------------------------
author: Brenden Conley
date: 2014-01-15 01:02:42.000000000

Patch Set 5: -Verified

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5041/

-------------------------------------
author: Brenden Conley
date: 2014-01-15 02:01:05.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5041/ : SUCCESS

-------------------------------------
author: Annalise Jimenez
date: 2014-01-15 15:00:07.000000000

Patch Set 5:

(2 comments)

Line:42, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> If you do not have the vtid context enabled on a trace, the minus_one is used for every event ;-)

Line:116, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> But do we have the certainty that ptr is never null?

-------------------------------------
author: Braxton Mccarthy
date: 2014-01-16 19:06:34.000000000

Patch Set 5:

(1 comment)

Line:116, lttng/org.eclipse.linuxtools.lttng2.ust.core/src/org/eclipse/linuxtools/internal/lttng2/ust/core/memoryusage/MemoryUsageStateProvider.java -> It *should* be, typically it's the getField() that can return null, and if the field exists it should have a value. But indeed, we have no guarantees (no null annotations!)

Probably safer to leave it like you did for now.

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