@@ -1216,13 +1216,15 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
1216
1216
1217
1217
void CodeHeapState::print_usedSpace (outputStream* out, CodeHeap* heap) {
1218
1218
if (!initialization_complete) {
1219
+ print_aggregate_missing (out, nullptr );
1219
1220
return ;
1220
1221
}
1221
1222
1222
1223
const char * heapName = get_heapName (heap);
1223
1224
get_HeapStatGlobals (out, heapName);
1224
1225
1225
1226
if ((StatArray == nullptr ) || (TopSizeArray == nullptr ) || (used_topSizeBlocks == 0 )) {
1227
+ print_aggregate_missing (out, heapName);
1226
1228
return ;
1227
1229
}
1228
1230
BUFFEREDSTREAM_DECL (ast, out)
@@ -1426,13 +1428,15 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
1426
1428
1427
1429
void CodeHeapState::print_freeSpace (outputStream* out, CodeHeap* heap) {
1428
1430
if (!initialization_complete) {
1431
+ print_aggregate_missing (out, nullptr );
1429
1432
return ;
1430
1433
}
1431
1434
1432
1435
const char * heapName = get_heapName (heap);
1433
1436
get_HeapStatGlobals (out, heapName);
1434
1437
1435
1438
if ((StatArray == nullptr ) || (FreeArray == nullptr ) || (alloc_granules == 0 )) {
1439
+ print_aggregate_missing (out, heapName);
1436
1440
return ;
1437
1441
}
1438
1442
BUFFEREDSTREAM_DECL (ast, out)
@@ -1600,13 +1604,15 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
1600
1604
1601
1605
void CodeHeapState::print_count (outputStream* out, CodeHeap* heap) {
1602
1606
if (!initialization_complete) {
1607
+ print_aggregate_missing (out, nullptr );
1603
1608
return ;
1604
1609
}
1605
1610
1606
1611
const char * heapName = get_heapName (heap);
1607
1612
get_HeapStatGlobals (out, heapName);
1608
1613
1609
1614
if ((StatArray == nullptr ) || (alloc_granules == 0 )) {
1615
+ print_aggregate_missing (out, heapName);
1610
1616
return ;
1611
1617
}
1612
1618
BUFFEREDSTREAM_DECL (ast, out)
@@ -1758,13 +1764,15 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
1758
1764
1759
1765
void CodeHeapState::print_space (outputStream* out, CodeHeap* heap) {
1760
1766
if (!initialization_complete) {
1767
+ print_aggregate_missing (out, nullptr );
1761
1768
return ;
1762
1769
}
1763
1770
1764
1771
const char * heapName = get_heapName (heap);
1765
1772
get_HeapStatGlobals (out, heapName);
1766
1773
1767
1774
if ((StatArray == nullptr ) || (alloc_granules == 0 )) {
1775
+ print_aggregate_missing (out, heapName);
1768
1776
return ;
1769
1777
}
1770
1778
BUFFEREDSTREAM_DECL (ast, out)
@@ -1927,13 +1935,15 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
1927
1935
1928
1936
void CodeHeapState::print_age (outputStream* out, CodeHeap* heap) {
1929
1937
if (!initialization_complete) {
1938
+ print_aggregate_missing (out, nullptr );
1930
1939
return ;
1931
1940
}
1932
1941
1933
1942
const char * heapName = get_heapName (heap);
1934
1943
get_HeapStatGlobals (out, heapName);
1935
1944
1936
1945
if ((StatArray == nullptr ) || (alloc_granules == 0 )) {
1946
+ print_aggregate_missing (out, heapName);
1937
1947
return ;
1938
1948
}
1939
1949
BUFFEREDSTREAM_DECL (ast, out)
@@ -2039,13 +2049,15 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
2039
2049
2040
2050
void CodeHeapState::print_names (outputStream* out, CodeHeap* heap) {
2041
2051
if (!initialization_complete) {
2052
+ print_aggregate_missing (out, nullptr );
2042
2053
return ;
2043
2054
}
2044
2055
2045
2056
const char * heapName = get_heapName (heap);
2046
2057
get_HeapStatGlobals (out, heapName);
2047
2058
2048
2059
if ((StatArray == nullptr ) || (alloc_granules == 0 )) {
2060
+ print_aggregate_missing (out, heapName);
2049
2061
return ;
2050
2062
}
2051
2063
BUFFEREDSTREAM_DECL (ast, out)
@@ -2343,6 +2355,14 @@ void CodeHeapState::print_line_delim(outputStream* out, bufferedStream* ast, cha
2343
2355
}
2344
2356
}
2345
2357
2358
+ void CodeHeapState::print_aggregate_missing (outputStream* out, const char * heapName) {
2359
+ if (heapName == nullptr ) {
2360
+ out->print_cr (" No aggregated code heap data available. Run function aggregate first." );
2361
+ } else {
2362
+ out->print_cr (" No aggregated data available for heap %s. Run function aggregate first." , heapName);
2363
+ }
2364
+ }
2365
+
2346
2366
// Find out which blob type we have at hand.
2347
2367
// Return "noType" if anything abnormal is detected.
2348
2368
CodeHeapState::blobType CodeHeapState::get_cbType (CodeBlob* cb) {
0 commit comments