8038332: The trace event vm/class/load is not always being sent

Added trace event vm/class/define

Reviewed-by: coleenp, egahlin, acorn
This commit is contained in:
Max Ockner 2016-07-25 09:40:31 -04:00
parent c076e4284c
commit 4945fbd459
2 changed files with 22 additions and 2 deletions

View File

@ -655,6 +655,21 @@ static void post_class_load_event(const Ticks& start_time,
#endif // INCLUDE_TRACE
}
// utility function for class define event
static void class_define_event(instanceKlassHandle k) {
#if INCLUDE_TRACE
EventClassDefine event(UNTIMED);
if (event.should_commit()) {
event.set_definedClass(k());
oop defining_class_loader = k->class_loader();
event.set_definingClassLoader(defining_class_loader != NULL ?
defining_class_loader->klass() : (Klass*)NULL);
event.commit();
}
#endif // INCLUDE_TRACE
}
Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
Handle class_loader,
Handle protection_domain,
@ -1675,9 +1690,8 @@ void SystemDictionary::define_instance_class(instanceKlassHandle k, TRAPS) {
JvmtiExport::post_class_load((JavaThread *) THREAD, k());
}
TRACE_KLASS_DEFINITION(k, THREAD);
class_define_event(k);
}
// Support parallel classloading

View File

@ -116,6 +116,12 @@ Declares a structure type that can be used in other events.
<value type="CLASS" field="initiatingClassLoader" label="Initiating Class Loader"/>
</event>
<event id="ClassDefine" path="vm/class/define" label="Class Define"
has_thread="true" has_stacktrace="true" is_instant="true">
<value type="CLASS" field="definedClass" label="Defined Class"/>
<value type="CLASS" field="definingClassLoader" label="Defining Class Loader"/>
</event>
<event id="ClassUnload" path="vm/class/unload" label="Class Unload"
has_thread="true" is_instant="true">
<value type="CLASS" field="unloadedClass" label="Unloaded Class"/>