RFR: 6846: Parser needs to skip events with no metadata [v2]

Erik Gahlin egahlin at openjdk.java.net
Tue Oct 13 03:16:09 UTC 2020


On Mon, 12 Oct 2020 21:50:20 GMT, Marcus Hirt <hirt at openjdk.org> wrote:

>> Also fixing some javadoc errors.
>
> Marcus Hirt has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Formatting

Changes requested by egahlin (Reviewer).

core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/TypeManager.java
line 480:

> 478: 	private static void skipEvent(int size, IDataInput input) throws IOException {
> 479: 		// We've read the size of the event (int) and the type (long) so far
> 480: 		for (int i = 0; i < size - DataInputToolkit.INTEGER_SIZE - DataInputToolkit.LONG_SIZE; i++) {

The size and event type ID field is likely compressed, so using a fixed constant size will not work.  I think you need
to find the offset of the first byte in the size field and then add the size to find next event.

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

PR: https://git.openjdk.java.net/jmc/pull/128


More information about the jmc-dev mailing list