10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
26 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
27 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
28 #include "gc/shenandoah/shenandoahHeapRegionCounters.hpp"
29 #include "memory/resourceArea.hpp"
30 #include "runtime/perfData.inline.hpp"
31
32 ShenandoahHeapRegionCounters::ShenandoahHeapRegionCounters() :
33 _last_sample_millis(0)
34 {
35 if (UsePerfData && ShenandoahRegionSampling) {
36 EXCEPTION_MARK;
37 ResourceMark rm;
38 ShenandoahHeap* heap = ShenandoahHeap::heap();
39 size_t num_regions = heap->num_regions();
40 const char* cns = PerfDataManager::name_space("shenandoah", "regions");
41 _name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtGC);
42 strcpy(_name_space, cns);
43
44 const char* cname = PerfDataManager::counter_name(_name_space, "timestamp");
45 _timestamp = PerfDataManager::create_long_variable(SUN_GC, cname, PerfData::U_None, CHECK);
46
47 cname = PerfDataManager::counter_name(_name_space, "max_regions");
48 PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None, num_regions, CHECK);
49
|
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
26 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
27 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
28 #include "gc/shenandoah/shenandoahHeapRegionCounters.hpp"
29 #include "memory/resourceArea.hpp"
30 #include "runtime/atomic.hpp"
31 #include "runtime/perfData.inline.hpp"
32
33 ShenandoahHeapRegionCounters::ShenandoahHeapRegionCounters() :
34 _last_sample_millis(0)
35 {
36 if (UsePerfData && ShenandoahRegionSampling) {
37 EXCEPTION_MARK;
38 ResourceMark rm;
39 ShenandoahHeap* heap = ShenandoahHeap::heap();
40 size_t num_regions = heap->num_regions();
41 const char* cns = PerfDataManager::name_space("shenandoah", "regions");
42 _name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtGC);
43 strcpy(_name_space, cns);
44
45 const char* cname = PerfDataManager::counter_name(_name_space, "timestamp");
46 _timestamp = PerfDataManager::create_long_variable(SUN_GC, cname, PerfData::U_None, CHECK);
47
48 cname = PerfDataManager::counter_name(_name_space, "max_regions");
49 PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None, num_regions, CHECK);
50
|