Skip to content
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

Support to parse PrintGCID #260

Merged
merged 6 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,36 @@ protected String parseTypeString(String line, ParseInformation pos) throws Parse
}
}

protected void parseId(String line, ParseInformation pos) throws ParseException {
if (!line.contains("#"))
return;
int i = pos.getIndex();
try {
// consume all leading spaces and '#'
final int lineLength = line.length();
final char[] lineChars = line.toCharArray();
char c = lineChars[i];
for (; i < lineLength; c = lineChars[++i]) {
if (c != ' ' && c != '#')
break;
}
if (i >= lineLength)
throw new ParseException("Unexpected end of line.", line);
// check whether the Id starts with a number
// -> skip number
for (; Character.isDigit(c) && i < lineLength; c = lineChars[++i]);
// -> skip ':'
for (; i<lineLength; c = lineChars[++i]) {
if (c != ':')
break;
}
}
finally {
i++;
pos.setIndex(i);
}
}

protected ExtendedType parseType(String line, ParseInformation pos) throws ParseException {
String typeString = parseTypeString(line, pos);
return getDataReaderTools().parseType(typeString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,8 @@ protected AbstractGCEvent<?> parseLine(String line, ParseInformation pos) throws
// pre-used->post-used, total, time
ZonedDateTime datestamp = parseDatestamp(line, pos);
double timestamp = getTimestamp(line, pos, datestamp);
// Support for PrintGCID
parseId(line, pos);
xiangzhai marked this conversation as resolved.
Show resolved Hide resolved
ExtendedType type = parseType(line, pos);
AbstractGCEvent<?> ae;
if (type.getConcurrency() == Concurrency.CONCURRENT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ protected AbstractGCEvent<?> parseLine(String line, ParseInformation pos) throws
// pre-used->post-used, total, time
ZonedDateTime datestamp = parseDatestamp(line, pos);
double timestamp = getTimestamp(line, pos, datestamp);
// Support for PrintGCID
parseId(line, pos);
ExtendedType type = parseType(line, pos);
// special provision for concurrent events
if (type.getConcurrency() == Concurrency.CONCURRENT) {
Expand Down Expand Up @@ -578,9 +580,12 @@ else if (type.getCollectionType().equals(CollectionType.VM_OPERATION)) {
parseDetailEventsIfExist(line, pos, event);

if (event.getExtendedType().getPattern() == GcPattern.GC_MEMORY_PAUSE) {
setMemoryAndPauses(event, line, pos);
}
else {
// Support for PrintGCID
xiangzhai marked this conversation as resolved.
Show resolved Hide resolved
if (line.contains("#"))
event.setPause(parsePause(line, pos));
else
setMemoryAndPauses(event, line, pos);
} else {
event.setPause(parsePause(line, pos));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ public String toString() {
public static final Type UJL_CMS_CONCURRENT_OLD = new Type("Old", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_MEMORY);

// unified jvm logging g1 event types
public static final Type UJL_G1_PAUSE_YOUNG = new Type("pause (G1 Evacuation Pause) (young)", Generation.YOUNG, Concurrency.SERIAL, GcPattern.GC_PAUSE);
xiangzhai marked this conversation as resolved.
Show resolved Hide resolved
public static final Type UJL_G1_PAUSE_MIXED = new Type("Pause Mixed", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_MEMORY_PAUSE);
public static final Type UJL_G1_TO_SPACE_EXHAUSTED = new Type("To-space exhausted", Generation.YOUNG, Concurrency.SERIAL, GcPattern.GC);
public static final Type UJL_G1_CONCURRENT_CYCLE = new Type("Concurrent Cycle", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);
Expand Down