1 /*
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
78 static void discard_SizeDistArray(outputStream* out);
79
80 static void update_SizeDistArray(outputStream* out, unsigned int len);
81
82 static const char* get_heapName(CodeHeap* heap);
83 static unsigned int findHeapIndex(outputStream* out, const char* heapName);
84 static void get_HeapStatGlobals(outputStream* out, const char* heapName);
85 static void set_HeapStatGlobals(outputStream* out, const char* heapName);
86
87 static void printBox(outputStream* out, const char border, const char* text1, const char* text2);
88 static void print_blobType_legend(outputStream* out);
89 static void print_space_legend(outputStream* out);
90 static void print_age_legend(outputStream* out);
91 static void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
92 static void print_count_single(outputStream *ast, unsigned short count);
93 static void print_space_single(outputStream *ast, unsigned short space);
94 static void print_age_single(outputStream *ast, unsigned int age);
95 static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
96 static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
97 static blobType get_cbType(CodeBlob* cb);
98
99 public:
100 static void discard(outputStream* out, CodeHeap* heap);
101 static void aggregate(outputStream* out, CodeHeap* heap, size_t granularity);
102 static void print_usedSpace(outputStream* out, CodeHeap* heap);
103 static void print_freeSpace(outputStream* out, CodeHeap* heap);
104 static void print_count(outputStream* out, CodeHeap* heap);
105 static void print_space(outputStream* out, CodeHeap* heap);
106 static void print_age(outputStream* out, CodeHeap* heap);
107 static void print_names(outputStream* out, CodeHeap* heap);
108 };
109
110 //----------------
111 // StatElement
112 //----------------
113 // Each analysis granule is represented by an instance of
114 // this StatElement struct. It collects and aggregates all
115 // information describing the allocated contents of the granule.
116 // Free (unallocated) contents is not considered (see FreeBlk for that).
117 // All StatElements of a heap segment are stored in the related StatArray.
|
1 /*
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018, 2019 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
78 static void discard_SizeDistArray(outputStream* out);
79
80 static void update_SizeDistArray(outputStream* out, unsigned int len);
81
82 static const char* get_heapName(CodeHeap* heap);
83 static unsigned int findHeapIndex(outputStream* out, const char* heapName);
84 static void get_HeapStatGlobals(outputStream* out, const char* heapName);
85 static void set_HeapStatGlobals(outputStream* out, const char* heapName);
86
87 static void printBox(outputStream* out, const char border, const char* text1, const char* text2);
88 static void print_blobType_legend(outputStream* out);
89 static void print_space_legend(outputStream* out);
90 static void print_age_legend(outputStream* out);
91 static void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
92 static void print_count_single(outputStream *ast, unsigned short count);
93 static void print_space_single(outputStream *ast, unsigned short space);
94 static void print_age_single(outputStream *ast, unsigned int age);
95 static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
96 static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
97 static blobType get_cbType(CodeBlob* cb);
98 static bool blob_access_is_safe(CodeBlob* this_blob, CodeBlob* prev_blob);
99
100 public:
101 static void discard(outputStream* out, CodeHeap* heap);
102 static void aggregate(outputStream* out, CodeHeap* heap, size_t granularity);
103 static void print_usedSpace(outputStream* out, CodeHeap* heap);
104 static void print_freeSpace(outputStream* out, CodeHeap* heap);
105 static void print_count(outputStream* out, CodeHeap* heap);
106 static void print_space(outputStream* out, CodeHeap* heap);
107 static void print_age(outputStream* out, CodeHeap* heap);
108 static void print_names(outputStream* out, CodeHeap* heap);
109 };
110
111 //----------------
112 // StatElement
113 //----------------
114 // Each analysis granule is represented by an instance of
115 // this StatElement struct. It collects and aggregates all
116 // information describing the allocated contents of the granule.
117 // Free (unallocated) contents is not considered (see FreeBlk for that).
118 // All StatElements of a heap segment are stored in the related StatArray.
|