DESCRIPTION

Add support for arrays or any CTF type.

A null pointer exception occured for events that contained an array
of something else than "int". For example, an array of struct:

fields := struct {
  ...
  struct  {
    string  arg_name;
    string  arg_value;
  } arguments[4];
};

With this fix, all arrays of CTF types are supported.

Sample output in the "Properties" view: http://i.imgur.com/31tqbgG.png

Change-Id: I3f2be314d1fd2bda8c95b208d018227477572fa8
Signed-off-by: Bradyn Guerra xxx@xxx.xxx


COMMENTS

author: Bradyn Guerra
date: 2013-11-28 04:22:16.000000000

Uploaded patch set 3.

-------------------------------------
author: Jordon Obrien
date: 2013-11-28 04:26:58.000000000

Patch Set 3: Code-Review+1

As far I can tell, it seems good.
Have you take a look in the unittest?
Do they have some? I know more tests are to come with ctf-testsuites.

-------------------------------------
author: Brenden Conley
date: 2013-11-28 08:13:23.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2013-11-28 08:53:01.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Ivy Mitchell
date: 2013-11-28 15:46:21.000000000

Patch Set 3: Code-Review+1 IP-Clean+1

(2 comments)

Line:7, /COMMIT_MSG -> please start the patch with "ctf: " next time.

Line:132, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java -> If you replace "[" "]" with '[' + i + ']', there will be no need for the nls comments.

-------------------------------------
author: Ivy Mitchell
date: 2013-11-28 18:35:23.000000000

Patch Set 3:

(1 comment)

comment that may or may not be a nit, Alexandre and I discussed and do not have an answer. This patch therefore needs to be tested in "content" and "properties" We will try to do so, but a unit test would be nice.

Line:336, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java -> Do we need this?

-------------------------------------
author: Braxton Mccarthy
date: 2013-11-28 18:37:13.000000000

Patch Set 3: Code-Review-1

(1 comment)

Hi François, welcome to Gerrit! Glad you could finally get access ;)

Good idea using the "subFields" in ITmfEventField to store arrays... honestly I don't why we didn't do it that way the first time (maybe we tried and hit unexpected issues? I honestly don't remember!)

However this means the the special IntegerArrayField is not needed anymore, it could reuse the general ArrayField method.

Tests would have to be added too (ideally with structs of each possible event types). I will play with it a bit later to see how it can work.

Line:132, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java -> Matthew is correct. Chars are faster than strings in general, so should be used where possible.

However, be careful when you do that: make sure the first variable is really a String. If it's an int or long, doing (val + 'a') will do the numerical addition of val and the ASCII value of 'a'. Been there, done that ;)

-------------------------------------
author: Jordon Obrien
date: 2013-11-28 18:40:36.000000000

Patch Set 3:

(1 comment)

more nits.

Line:14, /COMMIT_MSG -> too many space after struct.
and below after string.

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