DESCRIPTION

ctf: add get(byte[]) to bitbuffer

This allows for faster reads of chunks of data.

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


COMMENTS

author: Ivy Mitchell
date: 2014-06-13 15:32:53.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2014-06-13 15:32:58.000000000

Patch Set 7:

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

-------------------------------------
author: Braxton Mccarthy
date: 2014-06-13 16:21:51.000000000

Patch Set 7: Code-Review-1

(4 comments)

Also, the test plugin's version should follow the runtime plugin's (3.1).

Line:201, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/io/BitBufferTest.java -> xxx@xxx.xxx on the same line

Line:225, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/io/BitBufferTest.java -> same

Line:228, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/io/BitBufferTest.java -> You could have bad surprises because of UTF-16 ;)

Try changing the String above to "héllo world" and it breaks. I would be very careful if that is the planned use case of BitBuffer.get(byte[]).

Perhaps explicitely encode the string above to latin-1, to be clear?

Line:181, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/io/BitBuffer.java -> Why is fPosition a long? ByteBuffer only supports int, and since it defers to a ByteBuffer underneath, shouldn't fPosition be an int too? In any case, this cast would be unsafe.

Also, why enforce aligned reads only? Is this a limitation of ByteBuffer? If so, it should be commented about.

-------------------------------------
author: Brenden Conley
date: 2014-06-13 16:29:12.000000000

Patch Set 7: Verified+1

Build Successful 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-06-13 17:24:39.000000000

Patch Set 7:

(1 comment)

Line:181, lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/io/BitBuffer.java -> bitbuffer position == byte buffer position *8. So we need it to be long for large packets. (512 mb for instance) which actually happens.

As for the aligned reads, this is used only to read a chunk of data. We can post-process (shift) it later.

-------------------------------------
author: Ivy Mitchell
date: 2014-06-13 17:46:33.000000000

Patch Set 7:

(1 comment)

Line:228, lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/io/BitBufferTest.java -> really? if I change the string the test will fail!

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