gctoolkit icon indicating copy to clipboard operation
gctoolkit copied to clipboard

Fix for Legacy ZGC log files without details (-Xlog:gc)

Open jlittle-ptc opened this issue 11 months ago • 2 comments

zgc-noGen-java21-noDetail.log

Small log sample attached from Java 21 without +ZGenerational and using -Xlog:gc rather than -Xlog:gc* (detailed)

ZGCParser was unable to parse the events from this log as there is only one line logged per event, and thus, no "cycle start" that would generate the forwardReference. This is not an issue for Generational, as two lines are logged for each event, so the special case only applies to Full/Garbage type ZGC events.

Fixed this issue and added test cases for both Generational and non-generational lines without details to ZGCParserTest.

Also took the opportunity to update deprecated .getTimeStamp() calls to .toSeconds() in ZGCParserTest.

jlittle-ptc avatar Apr 30 '25 13:04 jlittle-ptc

@kcpeppe - I'm thinking we want to handle this is a consistent way across all collectors. We had the notion of using the diarizer to know whether the log didn't have enough detail. We discussed this in the (somewhat stale) PR #409

dsgrieve avatar May 01 '25 21:05 dsgrieve

I was debating taking a stab at #336 and implementing something like that where the diary would contain information about the Java Flags used from the command line if present (pre-unified) or what we can infer from unified logs during the diarizing process. I was thinking of adding a key/value map for storing this information rather than exclusively using flags as is currently done.

Unfortunately, my priorities are going to be shifting for a bit, so I'm not certain if I can get to it in the near term. But if you have some thoughts, I'm all ears.

jlittle-ptc avatar May 07 '25 12:05 jlittle-ptc

@jlittle-ptc apologies for not pushing on this earlier. We did merge another major refactor of the ZGC parser etc, so I'm afraid this will need a rebase.

karianna avatar Jun 23 '25 01:06 karianna

Hopefully I'll have some time this week to review the changes. There's a possibility that I might withdraw this PR and create a new one.

jlittle-ptc avatar Jun 23 '25 12:06 jlittle-ptc

Updated and posted a new PR #448. Closing this one.

jlittle-ptc avatar Jun 23 '25 18:06 jlittle-ptc