DESCRIPTION

TMF: Add function getFieldValue() to TmfEventField

This functions allows to directly get a field's value, recursively for struct
and variant fields with many levels of embedded fields.  Null is returned if
any level of field is not available.

Change-Id: I46691f62036f4e9826ee5f704efda74e71725acc
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2013-06-27 20:21:51.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-06-27 20:36:23.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-02 20:17:45.000000000

Patch Set 1: Code-Review-1

Not to be a party breaker, but are those really needed?

getFieldValue(name) can already be done with getField(name).getValue()? You have to handle one null check in both cases.

As for getFieldValue(names[]), this could be a nice convenience method, but we don't ever use events with nested fields, at least not in CTF afaik. Do you have such a use case?

-------------------------------------
author: Annalise Jimenez
date: 2013-07-02 20:47:38.000000000

Patch Set 1:

The first one (name) is just because there is a second one, for generality...  I guess it isn't absolutely necessary.

The second one is used for example with variant fields and struct.  For example, on my experimental branch of lttng-module, I have for network packets a variant that contains a struct, so that the value of my field in the event is "transport_fields", "thtype_tcp", "ack".  The getFieldValue(name[]) returns the value if the right variant is present, null otherwise.

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-02 21:18:23.000000000

Patch Set 1:

Ok fair enough, this is indeed more convenient to have in a method rather than having to walk a path every time.

Perhaps the method could be renamed to something more obvious, like getSubField(String[] path) ? I could also see it go in ITmfEventField, in many cases we don't have an exact reference type to the objects. Too bad for the API.

-------------------------------------
author: Annalise Jimenez
date: 2013-07-04 20:28:57.000000000

Abandoned

Gone to luna

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