RFR: 6846: Parser needs to skip events with no metadata [v2]
Marcus Hirt
hirt at openjdk.java.net
Tue Oct 13 09:34:14 UTC 2020
On Tue, 13 Oct 2020 03:09:56 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> Marcus Hirt has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Formatting
>
> 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.
Ugh. You're right. And what's even more fun, I don't need to do anything at all. The event read loop is already
handling it by seeking to the absolute position for the next event. Jumping to the next event is a noop - nothing needs
be done.
-------------
PR: https://git.openjdk.java.net/jmc/pull/128
More information about the jmc-dev
mailing list