RFR: 6846: Parser needs to skip events with no metadata [v2]
Marcus Hirt
hirt at openjdk.java.net
Tue Oct 13 09:38:07 UTC 2020
On Tue, 13 Oct 2020 09:31:16 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
>> 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.
Any chance you have a recording with a few events that has metadata, followed by an event with no metadata, then again
followed by a few events with metadata available? :)
-------------
PR: https://git.openjdk.java.net/jmc/pull/128
More information about the jmc-dev
mailing list