fprofiler.cpp revision 3863
0N/A/*
2051N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "classfile/classLoader.hpp"
1879N/A#include "code/vtableStubs.hpp"
1879N/A#include "gc_interface/collectedHeap.inline.hpp"
1879N/A#include "interpreter/interpreter.hpp"
1879N/A#include "memory/allocation.inline.hpp"
1879N/A#include "memory/universe.inline.hpp"
1879N/A#include "oops/oop.inline.hpp"
0N/A#include "oops/oop.inline2.hpp"
0N/A#include "oops/symbol.hpp"
0N/A#include "runtime/deoptimization.hpp"
0N/A#include "runtime/fprofiler.hpp"
0N/A#include "runtime/mutexLocker.hpp"
0N/A#include "runtime/stubCodeGenerator.hpp"
0N/A#include "runtime/stubRoutines.hpp"
0N/A#include "runtime/task.hpp"
0N/A#include "runtime/vframe.hpp"
0N/A#include "utilities/macros.hpp"
0N/A
0N/A// Static fields of FlatProfiler
0N/Aint FlatProfiler::received_gc_ticks = 0;
0N/Aint FlatProfiler::vm_operation_ticks = 0;
0N/Aint FlatProfiler::threads_lock_ticks = 0;
0N/Aint FlatProfiler::class_loader_ticks = 0;
0N/Aint FlatProfiler::extra_ticks = 0;
0N/Aint FlatProfiler::blocked_ticks = 0;
0N/Aint FlatProfiler::deopt_ticks = 0;
0N/Aint FlatProfiler::unknown_ticks = 0;
0N/Aint FlatProfiler::interpreter_ticks = 0;
0N/Aint FlatProfiler::compiler_ticks = 0;
0N/Aint FlatProfiler::received_ticks = 0;
0N/Aint FlatProfiler::delivered_ticks = 0;
0N/Aint* FlatProfiler::bytecode_ticks = NULL;
0N/Aint* FlatProfiler::bytecode_ticks_stub = NULL;
0N/Aint FlatProfiler::all_int_ticks = 0;
0N/Aint FlatProfiler::all_comp_ticks = 0;
0N/Aint FlatProfiler::all_ticks = 0;
0N/Abool FlatProfiler::full_profile_flag = false;
0N/AThreadProfiler* FlatProfiler::thread_profiler = NULL;
0N/AThreadProfiler* FlatProfiler::vm_thread_profiler = NULL;
0N/AFlatProfilerTask* FlatProfiler::task = NULL;
0N/AelapsedTimer FlatProfiler::timer;
0N/Aint FlatProfiler::interval_ticks_previous = 0;
0N/AIntervalData* FlatProfiler::interval_data = NULL;
3932N/A
0N/AThreadProfiler::ThreadProfiler() {
0N/A // Space for the ProfilerNodes
0N/A const int area_size = 1 * ProfilerNodeSize * 1024;
0N/A area_bottom = AllocateHeap(area_size, mtInternal);
0N/A area_top = area_bottom;
0N/A area_limit = area_bottom + area_size;
0N/A
0N/A // ProfilerNode pointer table
0N/A table = NEW_C_HEAP_ARRAY(ProfilerNode*, table_size, mtInternal);
0N/A initialize();
0N/A engaged = false;
0N/A}
0N/A
0N/AThreadProfiler::~ThreadProfiler() {
0N/A FreeHeap(area_bottom);
0N/A area_bottom = NULL;
0N/A area_top = NULL;
0N/A area_limit = NULL;
0N/A FreeHeap(table);
0N/A table = NULL;
0N/A}
0N/A
0N/A// Statics for ThreadProfiler
0N/Aint ThreadProfiler::table_size = 1024;
0N/A
0N/Aint ThreadProfiler::entry(int value) {
0N/A value = (value > 0) ? value : -value;
0N/A return value % table_size;
0N/A}
0N/A
0N/AThreadProfilerMark::ThreadProfilerMark(ThreadProfilerMark::Region r) {
0N/A Error!

 

There was an error!

null

java.lang.NullPointerException