7115199: Add event tracing hooks and Java Flight Recorder infrastructure

Added a nop tracing infrastructure, JFR makefile changes and other infrastructure used only by JFR.

Reviewed-by: acorn, sspitsyn
This commit is contained in:
Markus Gronlund 2012-01-11 17:34:02 -05:00 committed by Paul Hohensee
parent 849571d5b3
commit 007126d010
29 changed files with 352 additions and 11 deletions

View file

@ -48,6 +48,7 @@
#include "oops/typeArrayOop.hpp"
#include "prims/jni.h"
#include "prims/jniCheck.hpp"
#include "prims/jniExport.hpp"
#include "prims/jniFastGetField.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
@ -66,6 +67,8 @@
#include "runtime/signature.hpp"
#include "runtime/vm_operations.hpp"
#include "services/runtimeService.hpp"
#include "trace/tracing.hpp"
#include "trace/traceEventTypes.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
@ -5139,6 +5142,11 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v
if (JvmtiExport::should_post_thread_life()) {
JvmtiExport::post_thread_start(thread);
}
EVENT_BEGIN(TraceEventThreadStart, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(thread->threadObj())));
// Check if we should compile all classes on bootclasspath
NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
// Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
@ -5337,6 +5345,10 @@ static jint attach_current_thread(JavaVM *vm, void **penv, void *_args, bool dae
JvmtiExport::post_thread_start(thread);
}
EVENT_BEGIN(TraceEventThreadStart, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(thread->threadObj())));
*(JNIEnv**)penv = thread->jni_environment();
// Now leaving the VM, so change thread_state. This is normally automatically taken care
@ -5464,8 +5476,7 @@ jint JNICALL jni_GetEnv(JavaVM *vm, void **penv, jint version) {
return ret;
}
if (JvmtiExport::is_jvmti_version(version)) {
ret = JvmtiExport::get_jvmti_interface(vm, penv, version);
if (JniExportedInterface::GetExportedInterface(vm, penv, version, &ret)) {
return ret;
}