microsoft/gctoolkit

G1GC Collections with two sets of parenthesized parameters are not matched

jlittle-ptc opened this issue · 3 comments

Describe the bug
Given a GC event similar to the following:

[6.837s][info][gc] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 79M->27M(1024M) 2.929ms

The UnifiedG1GCPatterns.G1_COLLECTION GCParseRule does not seem to take the second parameter (G1 Evacuation Pause) into account, and these events are missed.

There is no other similar GCParseRules to handle this case that I can find. I'm not entirely clear on where the (G1 Evacuation Pause) text is coming from, though a "default" GC log with the Corretto JDK seems to use the same format, so this may be a Corretto thing?

No error is logged when running with the debug flag.

To Reproduce
Steps to reproduce the behavior:

  • Attempt to analyze the provided file with the library. (Sample app can be used)
  • gc.out.4.zip

Expected behavior

  • Events matching the above format are processed by the library.
  • Sample output is non-zero as events have been parsed.

Desktop (please complete the following information):

  • OS: Windows 11
  • Java Version: Amazon Corretto 11.0.19_7

From looking at some of the source code of OpenJDK vs Corretto, I've spotted a couple of differences where this might come into play. So this appears to be specific to Corretto.

On that note, if I were to take a stab at fixing this myself, would the preferred fix be to update the G1_COLLECTION rule with another conditional capture group, or to create a specific rule for these Corretto lines? (Do we need to capture the second parentheses? Might change indexes elsewhere...)

This should be picked up by the pattern for UnifiedG1GCPatterns.YOUNG_DETAILS.

@dsgrieve You're right. Not sure how I missed that.

It has led me to what seems to be the problem though. I'll close this thread off and post a new issue.