8173715: Remove FlatProfiler

Obsoleted Xprof flag, removed FlatProfiler code

Reviewed-by: dholmes, coleenp, vlivanov, pliden
This commit is contained in:
Gerard Ziemski 2017-08-31 20:26:53 -05:00
parent 1d5aeeb5f1
commit 59445a845c
43 changed files with 92 additions and 2447 deletions

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -88,11 +88,6 @@ ifneq ($(call check-jvm-feature, jvmci), true)
JVM_EXCLUDE_FILES += jvmciCodeInstaller_$(HOTSPOT_TARGET_CPU_ARCH).cpp
endif
ifneq ($(call check-jvm-feature, fprof), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_FPROF=0
JVM_EXCLUDE_FILES += fprofiler.cpp
endif
ifneq ($(call check-jvm-feature, vm-structs), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_VM_STRUCTS=0
JVM_EXCLUDE_FILES += vmStructs.cpp

@ -292,7 +292,7 @@ void MacroAssembler::verify_thread() {
if (VerifyThread) {
// NOTE: this chops off the heads of the 64-bit O registers.
// make sure G2_thread contains the right value
save_frame_and_mov(0, Lmethod, Lmethod); // to avoid clobbering O0 (and propagate Lmethod for -Xprof)
save_frame_and_mov(0, Lmethod, Lmethod); // to avoid clobbering O0 (and propagate Lmethod)
mov(G1, L1); // avoid clobbering G1
// G2 saved below
mov(G3, L3); // avoid clobbering G3
@ -398,7 +398,7 @@ void MacroAssembler::reset_last_Java_frame(void) {
#ifdef ASSERT
// check that it WAS previously set
save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod to helper frame for -Xprof
save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod to helper frame
ld_ptr(sp_addr, L0);
tst(L0);
breakpoint_trap(Assembler::zero, Assembler::ptr_cc);
@ -618,7 +618,7 @@ void MacroAssembler::set_vm_result(Register oop_result) {
# ifdef ASSERT
// Check that we are not overwriting any other oop.
save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod for -Xprof
save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod
ld_ptr(vm_result_addr, L0);
tst(L0);
restore();

@ -2607,11 +2607,10 @@ void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support
// the low-level signal-based suspend/resume support is a remnant from the
// The low-level signal-based suspend/resume support is a remnant from the
// old VM-suspension that used to be for java-suspension, safepoints etc,
// within hotspot. Now there is a single use-case for this:
// - calling get_thread_pc() on the VMThread by the flat-profiler task
// that runs in the watcher thread.
// within hotspot. Currently used by JFR's OSThreadSampler
//
// The remaining code is greatly simplified from the more general suspension
// code that used to be used.
//
@ -2627,7 +2626,13 @@ void os::hint_no_preempt() {}
//
// Note that the SR_lock plays no role in this suspend/resume protocol,
// but is checked for NULL in SR_handler as a thread termination indicator.
// The SR_lock is, however, used by JavaThread::java_suspend()/java_resume() APIs.
//
// Note that resume_clear_context() and suspend_save_context() are needed
// by SR_handler(), so that fetch_frame_from_ucontext() works,
// which in part is used by:
// - Forte Analyzer: AsyncGetCallTrace()
// - StackBanging: get_frame_at_stack_banging_point()
static void resume_clear_context(OSThread *osthread) {
osthread->set_ucontext(NULL);
@ -3634,44 +3639,6 @@ void os::SuspendedThreadTask::internal_do_task() {
}
}
class PcFetcher : public os::SuspendedThreadTask {
public:
PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
ExtendedPC result();
protected:
void do_task(const os::SuspendedThreadTaskContext& context);
private:
ExtendedPC _epc;
};
ExtendedPC PcFetcher::result() {
guarantee(is_done(), "task is not done yet.");
return _epc;
}
void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
Thread* thread = context.thread();
OSThread* osthread = thread->osthread();
if (osthread->ucontext() != NULL) {
_epc = os::Aix::ucontext_get_pc((const ucontext_t *) context.ucontext());
} else {
// NULL context is unexpected, double-check this is the VMThread.
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
}
}
// Suspends the target using the signal mechanism and then grabs the PC before
// resuming the target. Used by the flat-profiler only
ExtendedPC os::get_thread_pc(Thread* thread) {
// Make sure that it is called by the watcher for the VMThread.
assert(Thread::current()->is_Watcher_thread(), "Must be watcher");
assert(thread->is_VM_thread(), "Can only be called for VMThread");
PcFetcher fetcher(thread);
fetcher.run();
return fetcher.result();
}
////////////////////////////////////////////////////////////////////////////////
// debug support

@ -2603,11 +2603,10 @@ void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support
// the low-level signal-based suspend/resume support is a remnant from the
// The low-level signal-based suspend/resume support is a remnant from the
// old VM-suspension that used to be for java-suspension, safepoints etc,
// within hotspot. Now there is a single use-case for this:
// - calling get_thread_pc() on the VMThread by the flat-profiler task
// that runs in the watcher thread.
// within hotspot. Currently used by JFR's OSThreadSampler
//
// The remaining code is greatly simplified from the more general suspension
// code that used to be used.
//
@ -2623,6 +2622,13 @@ void os::hint_no_preempt() {}
//
// Note that the SR_lock plays no role in this suspend/resume protocol,
// but is checked for NULL in SR_handler as a thread termination indicator.
// The SR_lock is, however, used by JavaThread::java_suspend()/java_resume() APIs.
//
// Note that resume_clear_context() and suspend_save_context() are needed
// by SR_handler(), so that fetch_frame_from_ucontext() works,
// which in part is used by:
// - Forte Analyzer: AsyncGetCallTrace()
// - StackBanging: get_frame_at_stack_banging_point()
static void resume_clear_context(OSThread *osthread) {
osthread->set_ucontext(NULL);
@ -3521,45 +3527,6 @@ void os::SuspendedThreadTask::internal_do_task() {
}
}
///
class PcFetcher : public os::SuspendedThreadTask {
public:
PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
ExtendedPC result();
protected:
void do_task(const os::SuspendedThreadTaskContext& context);
private:
ExtendedPC _epc;
};
ExtendedPC PcFetcher::result() {
guarantee(is_done(), "task is not done yet.");
return _epc;
}
void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
Thread* thread = context.thread();
OSThread* osthread = thread->osthread();
if (osthread->ucontext() != NULL) {
_epc = os::Bsd::ucontext_get_pc((const ucontext_t *) context.ucontext());
} else {
// NULL context is unexpected, double-check this is the VMThread
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
}
}
// Suspends the target using the signal mechanism and then grabs the PC before
// resuming the target. Used by the flat-profiler only
ExtendedPC os::get_thread_pc(Thread* thread) {
// Make sure that it is called by the watcher for the VMThread
assert(Thread::current()->is_Watcher_thread(), "Must be watcher");
assert(thread->is_VM_thread(), "Can only be called for VMThread");
PcFetcher fetcher(thread);
fetcher.run();
return fetcher.result();
}
////////////////////////////////////////////////////////////////////////////////
// debug support

@ -4000,11 +4000,10 @@ void os::hint_no_preempt() {}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support
// the low-level signal-based suspend/resume support is a remnant from the
// The low-level signal-based suspend/resume support is a remnant from the
// old VM-suspension that used to be for java-suspension, safepoints etc,
// within hotspot. Now there is a single use-case for this:
// - calling get_thread_pc() on the VMThread by the flat-profiler task
// that runs in the watcher thread.
// within hotspot. Currently used by JFR's OSThreadSampler
//
// The remaining code is greatly simplified from the more general suspension
// code that used to be used.
//
@ -4020,6 +4019,13 @@ void os::hint_no_preempt() {}
//
// Note that the SR_lock plays no role in this suspend/resume protocol,
// but is checked for NULL in SR_handler as a thread termination indicator.
// The SR_lock is, however, used by JavaThread::java_suspend()/java_resume() APIs.
//
// Note that resume_clear_context() and suspend_save_context() are needed
// by SR_handler(), so that fetch_frame_from_ucontext() works,
// which in part is used by:
// - Forte Analyzer: AsyncGetCallTrace()
// - StackBanging: get_frame_at_stack_banging_point()
static void resume_clear_context(OSThread *osthread) {
osthread->set_ucontext(NULL);
@ -5060,44 +5066,6 @@ void os::SuspendedThreadTask::internal_do_task() {
}
}
class PcFetcher : public os::SuspendedThreadTask {
public:
PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
ExtendedPC result();
protected:
void do_task(const os::SuspendedThreadTaskContext& context);
private:
ExtendedPC _epc;
};
ExtendedPC PcFetcher::result() {
guarantee(is_done(), "task is not done yet.");
return _epc;
}
void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
Thread* thread = context.thread();
OSThread* osthread = thread->osthread();
if (osthread->ucontext() != NULL) {
_epc = os::Linux::ucontext_get_pc((const ucontext_t *) context.ucontext());
} else {
// NULL context is unexpected, double-check this is the VMThread
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
}
}
// Suspends the target using the signal mechanism and then grabs the PC before
// resuming the target. Used by the flat-profiler only
ExtendedPC os::get_thread_pc(Thread* thread) {
// Make sure that it is called by the watcher for the VMThread
assert(Thread::current()->is_Watcher_thread(), "Must be watcher");
assert(thread->is_VM_thread(), "Can only be called for VMThread");
PcFetcher fetcher(thread);
fetcher.run();
return fetcher.result();
}
////////////////////////////////////////////////////////////////////////////////
// debug support

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,12 +65,6 @@
void set_lwp_id(uint id) { _lwp_id = id; }
void set_native_priority(int prio) { _native_priority = prio; }
// ***************************************************************
// interrupt support. interrupts (using signals) are used to get
// the thread context (get_thread_pc), to set the thread context
// (set_thread_pc), and to implement java.lang.Thread.interrupt.
// ***************************************************************
public:
os::SuspendResume sr;

@ -3442,6 +3442,37 @@ void os::hint_no_preempt() {
schedctl_start(schedctl_init());
}
////////////////////////////////////////////////////////////////////////////////
// suspend/resume support
// The low-level signal-based suspend/resume support is a remnant from the
// old VM-suspension that used to be for java-suspension, safepoints etc,
// within hotspot. Currently used by JFR's OSThreadSampler
//
// The remaining code is greatly simplified from the more general suspension
// code that used to be used.
//
// The protocol is quite simple:
// - suspend:
// - sends a signal to the target thread
// - polls the suspend state of the osthread using a yield loop
// - target thread signal handler (SR_handler) sets suspend state
// and blocks in sigsuspend until continued
// - resume:
// - sets target osthread state to continue
// - sends signal to end the sigsuspend loop in the SR_handler
//
// Note that the SR_lock plays no role in this suspend/resume protocol,
// but is checked for NULL in SR_handler as a thread termination indicator.
// The SR_lock is, however, used by JavaThread::java_suspend()/java_resume() APIs.
//
// Note that resume_clear_context() and suspend_save_context() are needed
// by SR_handler(), so that fetch_frame_from_ucontext() works,
// which in part is used by:
// - Forte Analyzer: AsyncGetCallTrace()
// - StackBanging: get_frame_at_stack_banging_point()
// - JFR: get_topframe()-->....-->get_valid_uc_in_signal_handler()
static void resume_clear_context(OSThread *osthread) {
osthread->set_ucontext(NULL);
}
@ -3452,7 +3483,7 @@ static void suspend_save_context(OSThread *osthread, ucontext_t* context) {
static PosixSemaphore sr_semaphore;
void os::Solaris::SR_handler(Thread* thread, ucontext_t* uc) {
void os::Solaris::SR_handler(Thread* thread, ucontext_t* context) {
// Save and restore errno to avoid confusing native code with EINTR
// after sigsuspend.
int old_errno = errno;
@ -3462,7 +3493,7 @@ void os::Solaris::SR_handler(Thread* thread, ucontext_t* uc) {
os::SuspendResume::State current = osthread->sr.state();
if (current == os::SuspendResume::SR_SUSPEND_REQUEST) {
suspend_save_context(osthread, uc);
suspend_save_context(osthread, context);
// attempt to switch the state, we assume we had a SUSPEND_REQUEST
os::SuspendResume::State state = osthread->sr.suspended();
@ -3609,45 +3640,6 @@ void os::SuspendedThreadTask::internal_do_task() {
}
}
class PcFetcher : public os::SuspendedThreadTask {
public:
PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
ExtendedPC result();
protected:
void do_task(const os::SuspendedThreadTaskContext& context);
private:
ExtendedPC _epc;
};
ExtendedPC PcFetcher::result() {
guarantee(is_done(), "task is not done yet.");
return _epc;
}
void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
Thread* thread = context.thread();
OSThread* osthread = thread->osthread();
if (osthread->ucontext() != NULL) {
_epc = os::Solaris::ucontext_get_pc((const ucontext_t *) context.ucontext());
} else {
// NULL context is unexpected, double-check this is the VMThread
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
}
}
// A lightweight implementation that does not suspend the target thread and
// thus returns only a hint. Used for profiling only!
ExtendedPC os::get_thread_pc(Thread* thread) {
// Make sure that it is called by the watcher and the Threads lock is owned.
assert(Thread::current()->is_Watcher_thread(), "Must be watcher and own Threads_lock");
// For now, is only used to profile the VM Thread
assert(thread->is_VM_thread(), "Can only be called for VMThread");
PcFetcher fetcher(thread);
fetcher.run();
return fetcher.result();
}
// This does not do anything on Solaris. This is basically a hook for being
// able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
void os::os_exception_wrapper(java_call_t f, JavaValue* value,

@ -3506,22 +3506,6 @@ bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
return interrupted;
}
// Get's a pc (hint) for a running thread. Currently used only for profiling.
ExtendedPC os::get_thread_pc(Thread* thread) {
CONTEXT context;
context.ContextFlags = CONTEXT_CONTROL;
HANDLE handle = thread->osthread()->thread_handle();
if (GetThreadContext(handle, &context)) {
#ifdef _M_AMD64
return ExtendedPC((address) context.Rip);
#else
return ExtendedPC((address) context.Eip);
#endif
} else {
return ExtendedPC(NULL);
}
}
// GetCurrentThreadId() returns DWORD
intx os::current_thread_id() { return GetCurrentThreadId(); }

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -29,7 +29,6 @@
private:
void pd_initialize() {
_anchor.clear();
_last_interpreter_fp = NULL;
}
// The `last' frame is the youngest Java frame on the thread's stack.
@ -60,20 +59,4 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);
// -Xprof support
//
// In order to find the last Java fp from an async profile
// tick, we store the current interpreter fp in the thread.
// This value is only valid while we are in the C++ interpreter
// and profiling.
protected:
intptr_t *_last_interpreter_fp;
public:
static ByteSize last_interpreter_fp_offset() {
return byte_offset_of(JavaThread, _last_interpreter_fp);
}
intptr_t* last_interpreter_fp() { return _last_interpreter_fp; }
#endif // OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -30,7 +30,6 @@
void pd_initialize() {
_anchor.clear();
_last_interpreter_fp = NULL;
}
// The `last' frame is the youngest Java frame on the thread's stack.
@ -62,22 +61,4 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
protected:
// -Xprof support
//
// In order to find the last Java fp from an async profile
// tick, we store the current interpreter fp in the thread.
// This value is only valid while we are in the C++ interpreter
// and profiling.
intptr_t *_last_interpreter_fp;
public:
static ByteSize last_interpreter_fp_offset() {
return byte_offset_of(JavaThread, _last_interpreter_fp);
}
intptr_t* last_interpreter_fp() { return _last_interpreter_fp; }
#endif // OS_CPU_LINUX_PPC_VM_THREAD_LINUX_PPC_HPP

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -30,7 +30,6 @@
void pd_initialize() {
_anchor.clear();
_last_interpreter_fp = NULL;
}
// The `last' frame is the youngest Java frame on the thread's stack.
@ -61,22 +60,4 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
protected:
// -Xprof support
//
// In order to find the last Java fp from an async profile
// tick, we store the current interpreter fp in the thread.
// This value is only valid while we are in the C++ interpreter
// and profiling.
intptr_t *_last_interpreter_fp;
public:
static ByteSize last_interpreter_fp_offset() {
return byte_offset_of(JavaThread, _last_interpreter_fp);
}
intptr_t* last_interpreter_fp() { return _last_interpreter_fp; }
#endif // OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP

@ -12,7 +12,6 @@
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data (deprecated)
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java/VM (see documentation)
-Xcheck:jni perform additional checks for JNI functions

@ -57,7 +57,6 @@
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/init.hpp"
@ -1442,7 +1441,6 @@ InstanceKlass* ClassLoader::load_class(Symbol* name, bool search_append_only, TR
const char* const class_name = name->as_C_string();
EventMark m("loading class %s", class_name);
ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion);
const char* const file_name = file_name_for_class_name(class_name,
name->utf8_length());

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@
#include "gc/shared/collectedHeap.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/stubCodeGenerator.hpp"
@ -163,7 +162,6 @@ class decode_env {
bool _print_pc;
bool _print_bytes;
address _cur_insn;
int _total_ticks;
int _bytes_per_line; // arch-specific formatting option
static bool match(const char* event, const char* tag) {
@ -213,18 +211,6 @@ class decode_env {
_nm->print_code_comment_on(st, COMMENT_COLUMN, pc0, pc);
// this calls reloc_string_for which calls oop::print_value_on
}
// Output pc bucket ticks if we have any
if (total_ticks() != 0) {
address bucket_pc = FlatProfiler::bucket_start_for(pc);
if (bucket_pc != NULL && bucket_pc > pc0 && bucket_pc <= pc) {
int bucket_count = FlatProfiler::bucket_count_for(pc0);
if (bucket_count != 0) {
st->bol();
st->print_cr("%3.1f%% [%d]", bucket_count*100.0/total_ticks(), bucket_count);
}
}
}
// follow each complete insn by a nice newline
st->cr();
}
@ -233,8 +219,6 @@ class decode_env {
outputStream* output() { return _output; }
address cur_insn() { return _cur_insn; }
int total_ticks() { return _total_ticks; }
void set_total_ticks(int n) { _total_ticks = n; }
const char* options() { return _option_buf; }
};
@ -561,20 +545,6 @@ void Disassembler::decode(nmethod* nm, outputStream* st) {
#endif
env.output()->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT "] " JLONG_FORMAT " bytes", p2i(p), p2i(end), ((jlong)(end - p)));
// If there has been profiling, print the buckets.
if (FlatProfiler::bucket_start_for(p) != NULL) {
unsigned char* p1 = p;
int total_bucket_count = 0;
while (p1 < end) {
unsigned char* p0 = p1;
p1 += pd_instruction_alignment();
address bucket_pc = FlatProfiler::bucket_start_for(p1);
if (bucket_pc != NULL && bucket_pc > p0 && bucket_pc <= p1)
total_bucket_count += FlatProfiler::bucket_count_for(p0);
}
env.set_total_ticks(total_bucket_count);
}
// Print constant table.
if (nm->consts_size() > 0) {
nm->print_nmethod_labels(env.output(), nm->consts_begin());

@ -54,7 +54,6 @@ G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) :
_gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms):");
_gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms):");
_gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms):");
_gc_par_phases[FlatProfilerRoots] = new WorkerDataArray<double>(max_gc_threads, "FlatProfiler Roots (ms):");
_gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms):");
_gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms):");
_gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms):");

@ -49,7 +49,6 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
UniverseRoots,
JNIRoots,
ObjectSynchronizerRoots,
FlatProfilerRoots,
ManagementRoots,
SystemDictionaryRoots,
CLDGRoots,

@ -48,7 +48,6 @@
#include "prims/jvmtiExport.hpp"
#include "runtime/atomic.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/synchronizer.hpp"
#include "runtime/thread.hpp"
#include "runtime/vmThread.hpp"

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,6 @@
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/mutex.hpp"
#include "services/management.hpp"
#include "utilities/macros.hpp"
@ -271,13 +270,6 @@ void G1RootProcessor::process_vm_roots(G1RootClosures* closures,
}
}
{
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::FlatProfilerRoots, worker_i);
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_FlatProfiler_oops_do)) {
FlatProfiler::oops_do(strong_roots);
}
}
{
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_Management_oops_do)) {

@ -57,7 +57,6 @@ class G1RootProcessor : public StackObj {
G1RP_PS_Universe_oops_do,
G1RP_PS_JNIHandles_oops_do,
G1RP_PS_ObjectSynchronizer_oops_do,
G1RP_PS_FlatProfiler_oops_do,
G1RP_PS_Management_oops_do,
G1RP_PS_SystemDictionary_oops_do,
G1RP_PS_ClassLoaderDataGraph_oops_do,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,7 +39,6 @@
#include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/thread.hpp"
#include "runtime/vmThread.hpp"
@ -105,10 +104,6 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) {
ObjectSynchronizer::oops_do(&mark_and_push_closure);
break;
case flat_profiler:
FlatProfiler::oops_do(&mark_and_push_closure);
break;
case management:
Management::oops_do(&mark_and_push_closure);
break;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -94,12 +94,11 @@ class MarkFromRootsTask : public GCTask {
jni_handles = 2,
threads = 3,
object_synchronizer = 4,
flat_profiler = 5,
management = 6,
jvmti = 7,
system_dictionary = 8,
class_loader_data = 9,
code_cache = 10
management = 5,
jvmti = 6,
system_dictionary = 7,
class_loader_data = 8,
code_cache = 9
};
private:
RootType _root_type;

@ -50,7 +50,6 @@
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/vmThread.hpp"
#include "services/management.hpp"
@ -514,7 +513,6 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
MarkingCodeBlobClosure each_active_code_blob(mark_and_push_closure(), !CodeBlobToOopClosure::FixRelocations);
Threads::oops_do(mark_and_push_closure(), &each_active_code_blob);
ObjectSynchronizer::oops_do(mark_and_push_closure());
FlatProfiler::oops_do(mark_and_push_closure());
Management::oops_do(mark_and_push_closure());
JvmtiExport::oops_do(mark_and_push_closure());
SystemDictionary::always_strong_oops_do(mark_and_push_closure());
@ -607,7 +605,6 @@ void PSMarkSweep::mark_sweep_phase3() {
JNIHandles::oops_do(adjust_pointer_closure()); // Global (strong) JNI handles
Threads::oops_do(adjust_pointer_closure(), NULL);
ObjectSynchronizer::oops_do(adjust_pointer_closure());
FlatProfiler::oops_do(adjust_pointer_closure());
Management::oops_do(adjust_pointer_closure());
JvmtiExport::oops_do(adjust_pointer_closure());
SystemDictionary::oops_do(adjust_pointer_closure());

@ -60,7 +60,6 @@
#include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/vmThread.hpp"
#include "services/management.hpp"
@ -2086,7 +2085,6 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm,
// We scan the thread roots in parallel
Threads::create_thread_roots_marking_tasks(q);
q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::object_synchronizer));
q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::flat_profiler));
q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::management));
q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::system_dictionary));
q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::class_loader_data));
@ -2169,7 +2167,6 @@ void PSParallelCompact::adjust_roots(ParCompactionManager* cm) {
JNIHandles::oops_do(&oop_closure); // Global (strong) JNI handles
Threads::oops_do(&oop_closure, NULL);
ObjectSynchronizer::oops_do(&oop_closure);
FlatProfiler::oops_do(&oop_closure);
Management::oops_do(&oop_closure);
JvmtiExport::oops_do(&oop_closure);
SystemDictionary::oops_do(&oop_closure);

@ -49,7 +49,6 @@
#include "logging/log.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/vmThread.hpp"
@ -381,7 +380,6 @@ bool PSScavenge::invoke_no_policy() {
// We scan the thread roots in parallel
Threads::create_thread_roots_tasks(q);
q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::object_synchronizer));
q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::flat_profiler));
q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::management));
q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::system_dictionary));
q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::class_loader_data));

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,6 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/thread.hpp"
#include "runtime/vmThread.hpp"
#include "services/management.hpp"
@ -74,10 +73,6 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
ObjectSynchronizer::oops_do(&roots_closure);
break;
case flat_profiler:
FlatProfiler::oops_do(&roots_closure);
break;
case system_dictionary:
SystemDictionary::oops_do(&roots_closure);
break;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -57,12 +57,11 @@ class ScavengeRootsTask : public GCTask {
jni_handles = 2,
threads = 3,
object_synchronizer = 4,
flat_profiler = 5,
system_dictionary = 6,
class_loader_data = 7,
management = 8,
jvmti = 9,
code_cache = 10
system_dictionary = 5,
class_loader_data = 6,
management = 7,
jvmti = 8,
code_cache = 9
};
private:
RootType _root_type;

@ -46,7 +46,6 @@
#include "oops/instanceRefKlass.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/synchronizer.hpp"
#include "runtime/thread.inline.hpp"

@ -47,7 +47,6 @@
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
@ -71,7 +70,6 @@ enum GCH_strong_roots_tasks {
GCH_PS_Universe_oops_do,
GCH_PS_JNIHandles_oops_do,
GCH_PS_ObjectSynchronizer_oops_do,
GCH_PS_FlatProfiler_oops_do,
GCH_PS_Management_oops_do,
GCH_PS_SystemDictionary_oops_do,
GCH_PS_ClassLoaderDataGraph_oops_do,
@ -606,9 +604,6 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
if (!_process_strong_tasks->is_task_claimed(GCH_PS_ObjectSynchronizer_oops_do)) {
ObjectSynchronizer::oops_do(strong_roots);
}
if (!_process_strong_tasks->is_task_claimed(GCH_PS_FlatProfiler_oops_do)) {
FlatProfiler::oops_do(strong_roots);
}
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Management_oops_do)) {
Management::oops_do(strong_roots);
}

@ -63,7 +63,6 @@
#include "runtime/atomic.hpp"
#include "runtime/commandLineFlagConstraintList.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/init.hpp"
#include "runtime/java.hpp"

@ -61,7 +61,6 @@
#include "opto/runtime.hpp"
#include "opto/subnode.hpp"
#include "runtime/atomic.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/javaCalls.hpp"

@ -62,7 +62,6 @@
#include "runtime/atomic.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/fieldDescriptor.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/java.hpp"

@ -78,7 +78,6 @@ int Arguments::_num_jvm_args = 0;
char* Arguments::_java_command = NULL;
SystemProperty* Arguments::_system_properties = NULL;
const char* Arguments::_gc_log_filename = NULL;
bool Arguments::_has_profile = false;
size_t Arguments::_conservative_max_heap_alignment = 0;
size_t Arguments::_min_heap_size = 0;
Arguments::Mode Arguments::_mode = _mixed;
@ -3160,16 +3159,12 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xprof
// -Xprof
} else if (match_option(option, "-Xprof")) {
#if INCLUDE_FPROF
log_warning(arguments)("Option -Xprof was deprecated in version 9 and will likely be removed in a future release.");
_has_profile = true;
#else // INCLUDE_FPROF
jio_fprintf(defaultStream::error_stream(),
"Flat profiling is not supported in this VM.\n");
return JNI_ERR;
#endif // INCLUDE_FPROF
char version[256];
// Obsolete in JDK 10
JDK_Version::jdk(10).to_string(version, sizeof(version));
warning("Ignoring option %s; support was removed in %s", option->optionString, version);
// -Xconcurrentio
} else if (match_option(option, "-Xconcurrentio")) {
if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != Flag::SUCCESS) {

@ -412,7 +412,6 @@ class Arguments : AllStatic {
static bool _sun_java_launcher_is_altjvm;
// Option flags
static bool _has_profile;
static const char* _gc_log_filename;
// Value of the conservative maximum heap alignment needed
static size_t _conservative_max_heap_alignment;
@ -696,9 +695,6 @@ class Arguments : AllStatic {
// -Dsun.java.launcher.pid
static int sun_java_launcher_pid() { return _sun_java_launcher_pid; }
// -Xprof
static bool has_profile() { return _has_profile; }
// -Xms
static size_t min_heap_size() { return _min_heap_size; }
static void set_min_heap_size(size_t v) { _min_heap_size = v; }

File diff suppressed because it is too large Load Diff

@ -1,319 +0,0 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_RUNTIME_FPROFILER_HPP
#define SHARE_VM_RUNTIME_FPROFILER_HPP
#include "utilities/macros.hpp"
#include "runtime/timer.hpp"
// a simple flat profiler for Java
// Forward declaration of classes defined in this header file
class ThreadProfiler;
class ThreadProfilerMark;
class FlatProfiler;
class IntervalData;
// Declarations of classes defined only in the implementation.
class ProfilerNode;
class FlatProfilerTask;
enum TickPosition {
tp_code,
tp_native
};
// One of these guys is constructed as we enter interesting regions
// and destructed as we exit the region. While we are in the region
// ticks are allotted to the region.
class ThreadProfilerMark: public StackObj {
public:
// For now, the only thread-specific region is the class loader.
enum Region { noRegion, classLoaderRegion, extraRegion, maxRegion };
ThreadProfilerMark(Region) NOT_FPROF_RETURN;
~ThreadProfilerMark() NOT_FPROF_RETURN;
private:
ThreadProfiler* _pp;
Region _r;
};
#if INCLUDE_FPROF
class IntervalData VALUE_OBJ_CLASS_SPEC {
// Just to keep these things all together
private:
int _interpreted;
int _compiled;
int _native;
int _compiling;
public:
int interpreted() {
return _interpreted;
}
int compiled() {
return _compiled;
}
int native() {
return _native;
}
int compiling() {
return _compiling;
}
int total() {
return (interpreted() + compiled() + native() + compiling());
}
void inc_interpreted() {
_interpreted += 1;
}
void inc_compiled() {
_compiled += 1;
}
void inc_native() {
_native += 1;
}
void inc_compiling() {
_compiling += 1;
}
void reset() {
_interpreted = 0;
_compiled = 0;
_native = 0;
_compiling = 0;
}
static void print_header(outputStream* st);
void print_data(outputStream* st);
};
#endif // INCLUDE_FPROF
class ThreadProfiler: public CHeapObj<mtInternal> {
public:
ThreadProfiler() NOT_FPROF_RETURN;
~ThreadProfiler() NOT_FPROF_RETURN;
// Resets the profiler
void reset() NOT_FPROF_RETURN;
// Activates the profiler for a certain thread
void engage() NOT_FPROF_RETURN;
// Deactivates the profiler
void disengage() NOT_FPROF_RETURN;
// Prints the collected profiling information
void print(const char* thread_name) NOT_FPROF_RETURN;
// Garbage Collection Support
void oops_do(OopClosure* f) NOT_FPROF_RETURN;
#if INCLUDE_FPROF
private:
// for recording ticks.
friend class ProfilerNode;
char* area_bottom; // preallocated area for pnodes
char* area_top;
char* area_limit;
static int table_size;
ProfilerNode** table;
private:
void record_interpreted_tick(JavaThread* thread, frame fr, TickPosition where, int* ticks);
void record_compiled_tick (JavaThread* thread, frame fr, TickPosition where);
void interpreted_update(Method* method, TickPosition where);
void compiled_update (Method* method, TickPosition where);
void stub_update (Method* method, const char* name, TickPosition where);
void adapter_update (TickPosition where);
void runtime_stub_update(const CodeBlob* stub, const char* name, TickPosition where);
void unknown_compiled_update (const CodeBlob* cb, TickPosition where);
void vm_update (TickPosition where);
void vm_update (const char* name, TickPosition where);
void record_tick_for_running_frame(JavaThread* thread, frame fr);
void record_tick_for_calling_frame(JavaThread* thread, frame fr);
void initialize();
static int entry(int value);
private:
friend class FlatProfiler;
void record_tick(JavaThread* thread);
bool engaged;
// so we can do percentages for this thread, and quick checks for activity
int thread_ticks;
int compiler_ticks;
int interpreter_ticks;
public:
void inc_thread_ticks() { thread_ticks += 1; }
private:
friend class ThreadProfilerMark;
// counters for thread-specific regions
bool region_flag[ThreadProfilerMark::maxRegion];
int class_loader_ticks;
int extra_ticks;
private:
// other thread-specific regions
int blocked_ticks;
enum UnknownTickSites {
ut_null_method,
ut_vtable_stubs,
ut_running_frame,
ut_calling_frame,
ut_no_pc,
ut_no_last_Java_frame,
ut_unknown_thread_state,
ut_end
};
int unknown_ticks_array[ut_end];
int unknown_ticks() {
int result = 0;
for (int ut = 0; ut < ut_end; ut += 1) {
result += unknown_ticks_array[ut];
}
return result;
}
elapsedTimer timer;
// For interval timing
private:
IntervalData _interval_data;
IntervalData interval_data() {
return _interval_data;
}
IntervalData* interval_data_ref() {
return &_interval_data;
}
#endif // INCLUDE_FPROF
};
class FlatProfiler: AllStatic {
public:
static void reset() NOT_FPROF_RETURN ;
static void engage(JavaThread* mainThread, bool fullProfile) NOT_FPROF_RETURN ;
static void disengage() NOT_FPROF_RETURN ;
static void print(int unused) NOT_FPROF_RETURN ;
static bool is_active() NOT_FPROF_RETURN_(false) ;
// This is NULL if each thread has its own thread profiler,
// else this is the single thread profiler used by all threads.
// In particular it makes a difference during garbage collection,
// where you only want to traverse each thread profiler once.
static ThreadProfiler* get_thread_profiler() NOT_FPROF_RETURN_(NULL);
// Garbage Collection Support
static void oops_do(OopClosure* f) NOT_FPROF_RETURN ;
// Support for disassembler to inspect the PCRecorder
// Returns the start address for a given pc
// NULL is returned if the PCRecorder is inactive
static address bucket_start_for(address pc) NOT_FPROF_RETURN_(NULL);
enum { MillisecsPerTick = 10 }; // ms per profiling ticks
// Returns the number of ticks recorded for the bucket
// pc belongs to.
static int bucket_count_for(address pc) NOT_FPROF_RETURN_(0);
#if INCLUDE_FPROF
private:
static bool full_profile() {
return full_profile_flag;
}
friend class ThreadProfiler;
// the following group of ticks cover everything that's not attributed to individual Java methods
static int received_gc_ticks; // ticks during which gc was active
static int vm_operation_ticks; // total ticks in vm_operations other than GC
static int threads_lock_ticks; // the number of times we couldn't get the Threads_lock without blocking
static int blocked_ticks; // ticks when the thread was blocked.
static int class_loader_ticks; // total ticks in class loader
static int extra_ticks; // total ticks an extra temporary measuring
static int compiler_ticks; // total ticks in compilation
static int interpreter_ticks; // ticks in unknown interpreted method
static int deopt_ticks; // ticks in deoptimization
static int unknown_ticks; // ticks that cannot be categorized
static int received_ticks; // ticks that were received by task
static int delivered_ticks; // ticks that were delivered by task
static int non_method_ticks() {
return
( received_gc_ticks
+ vm_operation_ticks
+ deopt_ticks
+ threads_lock_ticks
+ blocked_ticks
+ compiler_ticks
+ interpreter_ticks
+ unknown_ticks );
}
static elapsedTimer timer;
// Counts of each of the byte codes
static int* bytecode_ticks;
static int* bytecode_ticks_stub;
static void print_byte_code_statistics();
// the ticks below are for continuous profiling (to adjust recompilation, etc.)
static int all_ticks; // total count of ticks received so far
static int all_int_ticks; // ticks in interpreter
static int all_comp_ticks; // ticks in compiled code (+ native)
static bool full_profile_flag; // collecting full profile?
// to accumulate thread-specific data
// if we aren't profiling individual threads.
static ThreadProfiler* thread_profiler;
static ThreadProfiler* vm_thread_profiler;
static void allocate_table();
// The task that periodically interrupts things.
friend class FlatProfilerTask;
static FlatProfilerTask* task;
static void record_vm_operation();
static void record_vm_tick();
static void record_thread_ticks();
// For interval analysis
private:
static int interval_ticks_previous; // delivered_ticks from the last interval
static void interval_record_thread(ThreadProfiler* tp); // extract ticks from ThreadProfiler.
static void interval_print(); // print interval data.
static void interval_reset(); // reset interval data.
enum {interval_print_size = 10};
static IntervalData* interval_data;
#endif // INCLUDE_FPROF
};
#endif // SHARE_VM_RUNTIME_FPROFILER_HPP

@ -55,7 +55,6 @@
#include "runtime/biasedLocking.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/init.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/java.hpp"
@ -465,12 +464,6 @@ void before_exit(JavaThread* thread) {
WatcherThread::stop();
}
// Print statistics gathered (profiling ...)
if (Arguments::has_profile()) {
FlatProfiler::disengage();
FlatProfiler::print(10);
}
// shut down the StatSampler task
StatSampler::disengage();
StatSampler::destroy();

@ -476,7 +476,6 @@ class os: AllStatic {
static frame fetch_frame_from_context(const void* ucVoid);
static frame fetch_frame_from_ucontext(Thread* thread, void* ucVoid);
static ExtendedPC get_thread_pc(Thread *thread);
static void breakpoint();
static bool start_debugging(char *buf, int buflen);

@ -63,7 +63,6 @@
#include "runtime/commandLineFlagWriteableList.hpp"
#include "runtime/commandLineFlagRangeList.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/globals.hpp"
#include "runtime/init.hpp"
@ -748,19 +747,6 @@ void JavaThread::record_jump(address target, address instr, const char* file,
}
#endif // PRODUCT
// Called by flat profiler
// Callers have already called wait_for_ext_suspend_completion
// The assertion for that is currently too complex to put here:
bool JavaThread::profile_last_Java_frame(frame* _fr) {
bool gotframe = false;
// self suspension saves needed state.
if (has_last_Java_frame() && _anchor.walkable()) {
*_fr = pd_last_frame();
gotframe = true;
}
return gotframe;
}
void Thread::interrupt(Thread* thread) {
debug_only(check_for_dangling_thread_pointer(thread);)
os::interrupt(thread);
@ -1381,14 +1367,6 @@ void WatcherThread::stop() {
while (watcher_thread() != NULL) {
// This wait should make safepoint checks, wait without a timeout,
// and wait as a suspend-equivalent condition.
//
// Note: If the FlatProfiler is running, then this thread is waiting
// for the WatcherThread to terminate and the WatcherThread, via the
// FlatProfiler task, is waiting for the external suspend request on
// this thread to complete. wait_for_ext_suspend_completion() will
// eventually timeout, but that takes time. Making this wait a
// suspend-equivalent condition solves that timeout problem.
//
Terminator_lock->wait(!Mutex::_no_safepoint_check_flag, 0,
Mutex::_as_suspend_equivalent_flag);
}
@ -1505,16 +1483,6 @@ void JavaThread::initialize() {
}
#endif // PRODUCT
set_thread_profiler(NULL);
if (FlatProfiler::is_active()) {
// This is where we would decide to either give each thread it's own profiler
// or use one global one from FlatProfiler,
// or up to some count of the number of profiled threads, etc.
ThreadProfiler* pp = new ThreadProfiler();
pp->engage();
set_thread_profiler(pp);
}
// Setup safepoint state info for this thread
ThreadSafepointState::create(this);
@ -1660,7 +1628,6 @@ JavaThread::~JavaThread() {
// All Java related clean up happens in exit
ThreadSafepointState::destroy(this);
if (_thread_profiler != NULL) delete _thread_profiler;
if (_thread_stat != NULL) delete _thread_stat;
#if INCLUDE_JVMCI
@ -1775,13 +1742,6 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
Handle threadObj(this, this->threadObj());
assert(threadObj.not_null(), "Java thread object should be created");
if (get_thread_profiler() != NULL) {
get_thread_profiler()->disengage();
ResourceMark rm;
get_thread_profiler()->print(get_thread_name());
}
// FIXIT: This code should be moved into else part, when reliable 1.2/1.3 check is in place
{
EXCEPTION_MARK;
@ -1983,12 +1943,6 @@ void JavaThread::initialize_queues() {
#endif // INCLUDE_ALL_GCS
void JavaThread::cleanup_failed_attach_current_thread() {
if (get_thread_profiler() != NULL) {
get_thread_profiler()->disengage();
ResourceMark rm;
get_thread_profiler()->print(get_thread_name());
}
if (active_handles() != NULL) {
JNIHandleBlock* block = active_handles();
set_active_handles(NULL);
@ -2786,9 +2740,6 @@ void JavaThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
// Verify that the deferred card marks have been flushed.
assert(deferred_card_mark().is_empty(), "Should be empty during GC");
// The ThreadProfiler oops_do is done from FlatProfiler::oops_do
// since there may be more than one thread using each ThreadProfiler.
// Traverse the GCHandles
Thread::oops_do(f, cf);
@ -3841,7 +3792,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
}
#endif // INCLUDE_MANAGEMENT
if (Arguments::has_profile()) FlatProfiler::engage(main_thread, true);
if (MemProfiling) MemProfiler::engage();
StatSampler::engage();
if (CheckJNICalls) JniPeriodicChecker::engage();
@ -4136,7 +4086,7 @@ void JavaThread::invoke_shutdown_hooks() {
// + Call before_exit(), prepare for VM exit
// > run VM level shutdown hooks (they are registered through JVM_OnExit(),
// currently the only user of this mechanism is File.deleteOnExit())
// > stop flat profiler, StatSampler, watcher thread, CMS threads,
// > stop StatSampler, watcher thread, CMS threads,
// post thread end and vm death events to JVMTI,
// stop signal thread
// + Call JavaThread::exit(), it will:
@ -4165,14 +4115,6 @@ bool Threads::destroy_vm() {
while (Threads::number_of_non_daemon_threads() > 1)
// This wait should make safepoint checks, wait without a timeout,
// and wait as a suspend-equivalent condition.
//
// Note: If the FlatProfiler is running and this thread is waiting
// for another non-daemon thread to finish, then the FlatProfiler
// is waiting for the external suspend request on this thread to
// complete. wait_for_ext_suspend_completion() will eventually
// timeout, but that takes time. Making this wait a suspend-
// equivalent condition solves that timeout problem.
//
Threads_lock->wait(!Mutex::_no_safepoint_check_flag, 0,
Mutex::_as_suspend_equivalent_flag);
}

@ -56,7 +56,6 @@
#endif
class ThreadSafepointState;
class ThreadProfiler;
class JvmtiThreadState;
class JvmtiGetLoadedClassesClosure;
@ -1720,23 +1719,6 @@ class JavaThread: public Thread {
void deoptimized_wrt_marked_nmethods();
// Profiling operation (see fprofile.cpp)
public:
bool profile_last_Java_frame(frame* fr);
private:
ThreadProfiler* _thread_profiler;
private:
friend class FlatProfiler; // uses both [gs]et_thread_profiler.
friend class FlatProfilerTask; // uses get_thread_profiler.
friend class ThreadProfilerMark; // uses get_thread_profiler.
ThreadProfiler* get_thread_profiler() { return _thread_profiler; }
ThreadProfiler* set_thread_profiler(ThreadProfiler* tp) {
ThreadProfiler* result = _thread_profiler;
_thread_profiler = tp;
return result;
}
public:
// Returns the running thread as a JavaThread
static inline JavaThread* current();

@ -65,18 +65,6 @@
#define NOT_JVMTI_RETURN_(code) { return code; }
#endif // INCLUDE_JVMTI
#ifndef INCLUDE_FPROF
#define INCLUDE_FPROF 1
#endif
#if INCLUDE_FPROF
#define NOT_FPROF_RETURN /* next token must be ; */
#define NOT_FPROF_RETURN_(code) /* next token must be ; */
#else
#define NOT_FPROF_RETURN {}
#define NOT_FPROF_RETURN_(code) { return code; }
#endif // INCLUDE_FPROF
#ifndef INCLUDE_VM_STRUCTS
#define INCLUDE_VM_STRUCTS 1
#endif

@ -110,7 +110,6 @@ public class TestGCLogMessages {
new LogMessageWithLevel("Universe Roots", Level.TRACE),
new LogMessageWithLevel("JNI Handles Roots", Level.TRACE),
new LogMessageWithLevel("ObjectSynchronizer Roots", Level.TRACE),
new LogMessageWithLevel("FlatProfiler Roots", Level.TRACE),
new LogMessageWithLevel("Management Roots", Level.TRACE),
new LogMessageWithLevel("SystemDictionary Roots", Level.TRACE),
new LogMessageWithLevel("CLDG Roots", Level.TRACE),

@ -42,7 +42,6 @@ public class TestNullTerminatedFlags {
"-green",
"-native",
"-Xrs",
"-Xprof",
"-Xconcurrentio",
"-Xinternalversion",
"-Xprintflags",

@ -1,44 +0,0 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @requires vm.flavor == "minimal"
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @run driver Xprof
*/
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public class Xprof {
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-minimal", "-Xprof", "-version");
new OutputAnalyzer(pb.start())
.shouldContain("Flat profiling is not supported in this VM.")
.shouldHaveExitValue(1);
}
}