-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ZGC logging #216
Changes from 22 commits
81dcfcf
dda185a
9643bd8
84205d6
1a05f67
d7e2405
66e9c1b
75f83bb
1256031
238050f
9b7aad5
8b00e90
b3fc7f6
5a9b562
1f681bd
1fdb0a0
52b4111
ba10ced
03284fc
70598e9
2576e5d
18d4275
8925464
d29aa3c
2cb14fb
75c7f6e
e8ea44e
ad1ca4b
0eb52d4
53355b4
3ecd294
ac4f08b
907a3be
4793b3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,13 +79,14 @@ public ExtendedType parseTypeWithCause(String typeName) { | |
typeName = typeName.trim(); | ||
ExtendedType extendedType = null; | ||
String lookupTypeName = getLookupTypeName(typeName); | ||
|
||
AbstractGCEvent.Type gcType = AbstractGCEvent.Type.lookup(lookupTypeName); | ||
// the gcType may be null because there was a PrintGCCause flag enabled - if so, reparse it with the first paren set stripped | ||
if (gcType == null) { | ||
// try to parse it again with the parens removed | ||
Matcher parenMatcher = parenthesesPattern.matcher(lookupTypeName); | ||
if (parenMatcher.find()) { | ||
gcType = AbstractGCEvent.Type.lookup(parenMatcher.replaceFirst("")); | ||
// try to parse it again with the parents removed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is "parents" an established abbrevation for "parenthesis"? If not, I'd prefer the renaming to go to "parenthesisMatcher" to avoid confusion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! I think we got confused too while renaming this, will fix this. |
||
Matcher parentMatcher = parenthesesPattern.matcher(lookupTypeName); | ||
if (parentMatcher.find()) { | ||
gcType = AbstractGCEvent.Type.lookup(parentMatcher.replaceFirst("")); | ||
} | ||
} | ||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ public abstract class AbstractGCEvent<T extends AbstractGCEvent<T>> implements S | |
private int preUsed; | ||
/** Used after GC in KB */ | ||
private int postUsed; | ||
/** Percentage used before GC */ | ||
private int preUsedPercent; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it really worthwhile to store this information? Can't it be calculated, if needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, I don't think it's worthwhile to have this, I will remove this. |
||
/** Percentage used after GC */ | ||
private int postUsedPercent; | ||
/** Capacity in KB */ | ||
private int total; | ||
/** end of gc event (after pause) */ | ||
|
@@ -209,6 +213,14 @@ public void setPostUsed(int postUsed) { | |
this.postUsed = postUsed; | ||
} | ||
|
||
public void setPreUsedPercent(int preUsedPercent) { | ||
this.preUsedPercent = preUsedPercent; | ||
} | ||
|
||
public void setPostUsedPercent(int postUsedPercent) { | ||
this.postUsedPercent = postUsedPercent; | ||
} | ||
|
||
public void setTotal(int total) { | ||
this.total = total; | ||
} | ||
|
@@ -221,6 +233,14 @@ public int getPostUsed() { | |
return postUsed; | ||
} | ||
|
||
public int getPreUsedPercent() { | ||
return preUsedPercent; | ||
} | ||
|
||
public int getPostUsedPercent() { | ||
return postUsedPercent; | ||
} | ||
|
||
public int getTotal() { | ||
return total; | ||
} | ||
|
@@ -306,6 +326,10 @@ public boolean hasPause() { | |
|| getExtendedType().getPattern().equals(GcPattern.GC_PAUSE_DURATION); | ||
} | ||
|
||
public boolean isCycleStart() { | ||
return Type.UJL_ZGC_GARBAGE_COLLECTION.equals(getExtendedType().getType()); | ||
} | ||
|
||
public double getPause() { | ||
return pause; | ||
} | ||
|
@@ -649,6 +673,20 @@ public String toString() { | |
public static final Type UJL_SHEN_CONCURRENT_CONC_UPDATE_REFS = new Type("Concurrent update references", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_MEMORY_PAUSE); | ||
public static final Type UJL_SHEN_CONCURRENT_PRECLEANING = new Type("Concurrent precleaning", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_MEMORY_PAUSE); | ||
|
||
// unified jvm logging ZGC event types | ||
public static final Type UJL_ZGC_GARBAGE_COLLECTION = new Type("Garbage Collection", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_MEMORY_PERCENTAGE); | ||
public static final Type UJL_ZGC_PAUSE_MARK_START = new Type("Pause Mark Start", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_PAUSE_MARK_END = new Type("Pause Mark End", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_PAUSE_RELOCATE_START = new Type("Pause Relocate Start", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_MARK = new Type("Concurrent Mark", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_NONREF = new Type("Concurrent Process Non-Strong References", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_RESET_RELOC_SET = new Type("Concurrent Reset Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_DETATCHED_PAGES = new Type("Concurrent Destroy Detached Pages", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_SELECT_RELOC_SET = new Type("Concurrent Select Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_PREPARE_RELOC_SET = new Type("Concurrent Prepare Relocation Set", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_CONCURRENT_RELOCATE = new Type("Concurrent Relocate", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE); | ||
public static final Type UJL_ZGC_HEAP_CAPACITY = new Type("Capacity", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_HEAP_MEMORY_PERCENTAGE); | ||
|
||
// IBM Types | ||
// TODO: are scavenge always young only?? | ||
public static final Type IBM_AF = new Type("af", Generation.YOUNG); | ||
|
@@ -689,17 +727,21 @@ public enum GcPattern { | |
GC_MEMORY_PAUSE, | ||
/** "GC type": "# regions before"->"# regions after"[("#total regions")] ("total regions" is optional; needs a region size to calculate memory usage)*/ | ||
GC_REGION, | ||
/** "Garbage Collection (Reason)" "memory before"("percentage of total")->"memory after"("percentage of total") */ | ||
GC_MEMORY_PERCENTAGE, | ||
/** "Heap memory type" "memory current"("memory percentage") */ | ||
GC_HEAP_MEMORY_PERCENTAGE | ||
} | ||
|
||
public enum Concurrency { CONCURRENT, SERIAL }; | ||
public enum Concurrency { CONCURRENT, SERIAL } | ||
|
||
public enum Generation { YOUNG, | ||
TENURED, | ||
/** also used for "metaspace" that is introduced with java 8 */ | ||
PERM, | ||
ALL, | ||
/** special value for vm operations that are not collections */ | ||
OTHER }; | ||
OTHER } | ||
|
||
public enum CollectionType { | ||
/** plain GC pause collection garbage */ | ||
|
@@ -712,5 +754,5 @@ public enum CollectionType { | |
*/ | ||
VM_OPERATION, | ||
/** stop the world pause but used to prepare concurrent collection, might not collect garbage */ | ||
CONCURRENCY_HELPER }; | ||
CONCURRENCY_HELPER } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this fixes the build failure on the develop branch - thank you very much!