109 // +UseLargePages: large page size <= G1HeapRegionSize |
109 // +UseLargePages: large page size <= G1HeapRegionSize |
110 // |
110 // |
111 // Each 'int' represents a numa id of single HeapRegion (bottom page). |
111 // Each 'int' represents a numa id of single HeapRegion (bottom page). |
112 // e.g. 1MB heap region, 2MB page size and 2 NUMA nodes system |
112 // e.g. 1MB heap region, 2MB page size and 2 NUMA nodes system |
113 // Check the first set(2 regions) |
113 // Check the first set(2 regions) |
114 // 0| ...omitted..| 00 |
114 // 0| ...omitted..| 0 |
115 // 1| ...omitted..| 01 |
115 // 1| ...omitted..| 1 |
116 static void checkCase1Pattern(OutputAnalyzer output, int index, long g1HeapRegionSize, long actualPageSize, int[] memoryNodeIds) throws Exception { |
116 static void checkCase1Pattern(OutputAnalyzer output, int index, long g1HeapRegionSize, long actualPageSize, int[] memoryNodeIds) throws Exception { |
117 StringBuilder sb = new StringBuilder(); |
117 StringBuilder sb = new StringBuilder(); |
118 |
118 |
119 // Append index which means heap region index. |
119 // Append index which means heap region index. |
120 sb.append(String.format("%6d", index)); |
120 sb.append(String.format("%6d", index)); |
121 sb.append("| .* | "); |
121 sb.append("| .* | "); |
122 |
122 |
123 // Append page node id. |
123 // Append page node id. |
124 sb.append(String.format("%02d", memoryNodeIds[index])); |
124 sb.append(memoryNodeIds[index]); |
125 |
125 |
126 output.shouldMatch(sb.toString()); |
126 output.shouldMatch(sb.toString()); |
127 } |
127 } |
128 |
128 |
129 // 3. +UseLargePages: large page size > G1HeapRegionSize |
129 // 3. +UseLargePages: large page size > G1HeapRegionSize |
130 // |
130 // |
131 // As a OS page is consist of multiple heap regions, log also should be |
131 // As a OS page is consist of multiple heap regions, log also should be |
132 // printed multiple times for same numa id. |
132 // printed multiple times for same numa id. |
133 // e.g. 1MB heap region, 2MB page size and 2 NUMA nodes system |
133 // e.g. 1MB heap region, 2MB page size and 2 NUMA nodes system |
134 // Check the first set(4 regions) |
134 // Check the first set(4 regions) |
135 // 0| ...omitted..| 00 |
135 // 0| ...omitted..| 0 |
136 // 1| ...omitted..| 00 |
136 // 1| ...omitted..| 0 |
137 // 2| ...omitted..| 01 |
137 // 2| ...omitted..| 1 |
138 // 3| ...omitted..| 01 |
138 // 3| ...omitted..| 1 |
139 static void checkCase2Pattern(OutputAnalyzer output, int index, long g1HeapRegionSize, long actualPageSize, int[] memoryNodeIds) throws Exception { |
139 static void checkCase2Pattern(OutputAnalyzer output, int index, long g1HeapRegionSize, long actualPageSize, int[] memoryNodeIds) throws Exception { |
140 StringBuilder sb = new StringBuilder(); |
140 StringBuilder sb = new StringBuilder(); |
141 |
141 |
142 // Append page range. |
142 // Append page range. |
143 int lines_to_print = (int)(actualPageSize / g1HeapRegionSize); |
143 int lines_to_print = (int)(actualPageSize / g1HeapRegionSize); |