Skip to content

Commit 588913c

Browse files
author
Ben Taylor
committed
8290966: G1: Record number of PLAB filled and number of direct allocations
Reviewed-by: shade Backport-of: 30205bb289e9b25d60474b24b891e15923071b5a
1 parent ec0ffa2 commit 588913c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/hotspot/jtreg/gc/g1/plab/lib/LogParser.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
*
3838
* Typical GC log with PLAB statistics (options - -Xlog:gc=debug,gc+plab=debug) looks like:
3939
*
40-
* [0.330s][debug][gc,plab ] GC(0) Young PLAB allocation: allocated: 1825632B, wasted: 29424B, unused: 2320B, used: 1793888B, undo waste: 0B,
41-
* [0.330s][debug][gc,plab ] GC(0) Young other allocation: region end waste: 0B, regions filled: 2, direct allocated: 271520B, failure used: 0B, failure wasted: 0B
42-
* [0.330s][debug][gc,plab ] GC(0) Young sizing: calculated: 358776B, actual: 358776B
43-
* [0.330s][debug][gc,plab ] GC(0) Old PLAB allocation: allocated: 427248B, wasted: 592B, unused: 368584B, used: 58072B, undo waste: 0B,
44-
* [0.330s][debug][gc,plab ] GC(0) Old other allocation: region end waste: 0B, regions filled: 1, direct allocated: 41704B, failure used: 0B, failure wasted: 0B
45-
* [0.330s][debug][gc,plab ] GC(0) Old sizing: calculated: 11608B, actual: 11608B
40+
* [0.192s][debug][gc,plab ] GC(0) Young PLAB allocation: allocated: 2867184B, wasted: 656B, unused: 252896B, used: 2613632B, undo waste: 0B,
41+
* [0.192s][debug][gc,plab ] GC(0) Young other allocation: region end waste: 0B, regions filled: 3, num plab filled: 30, direct allocated: 16400B, num direct allocated: 1, failure used: 0B, failure wasted: 0B
42+
* [0.192s][debug][gc,plab ] GC(0) Young sizing: calculated: 522720B, actual: 522720B
43+
* [0.192s][debug][gc,plab ] GC(0) Old PLAB allocation: allocated: 0B, wasted: 0B, unused: 0B, used: 0B, undo waste: 0B,
44+
* [0.192s][debug][gc,plab ] GC(0) Old other allocation: region end waste: 0B, regions filled: 0, num plab filled: 0, direct allocated: 0B, num direct allocated: 0, failure used: 0B, failure wasted: 0B
45+
* [0.192s][debug][gc,plab ] GC(0) Old sizing: calculated: 0B, actual: 2064B
4646
*/
4747
final public class LogParser {
4848

@@ -62,7 +62,8 @@ public static enum ReportType {
6262
// GC ID
6363
private static final Pattern GC_ID_PATTERN = Pattern.compile("\\[gc,plab\\s*\\] GC\\((\\d+)\\)");
6464
// Pattern for extraction pair <name>: <numeric value>
65-
private static final Pattern PAIRS_PATTERN = Pattern.compile("\\w* \\w+:\\s+\\d+");
65+
// This is a non-zero set of words separated by spaces followed by ":" and a value.
66+
private static final Pattern PAIRS_PATTERN = Pattern.compile("(?:\\w+ )*\\w+:\\s+\\d+");
6667

6768
/**
6869
* Construct LogParser object, parse log file with PLAB statistics and store it into report.
@@ -119,7 +120,7 @@ private PlabReport parseLines() throws NumberFormatException {
119120
do {
120121
String pair = matcher.group();
121122
String[] nameValue = pair.replaceAll(": ", ":").split(":");
122-
plabInfo.put(nameValue[0].trim(), Long.parseLong(nameValue[1]));
123+
plabInfo.put(nameValue[0], Long.parseLong(nameValue[1]));
123124
} while (matcher.find());
124125
}
125126
}
@@ -194,7 +195,7 @@ private Map<Long, PlabInfo> getSpecifiedStats(List<Long> gcIds, LogParser.Report
194195
getEntries().entryStream()
195196
.filter(gcLogItem -> extractId == gcIds.contains(gcLogItem.getKey()))
196197
.collect(Collectors.toMap(gcLogItem -> gcLogItem.getKey(),
197-
gcLogItem -> gcLogItem.getValue().get(type).filter(fieldNames)
198+
gcLogItem -> gcLogItem.getValue().get(type).filter(fieldNames)
198199
)
199200
)
200201
);

0 commit comments

Comments
 (0)