8081219: hs_err improvement: Add event logging for class redefinition to the hs_err file

Use the Events::log function to save redefined classes for output to the hs_err file.

Reviewed-by: sspitsyn, jiangli, lfoltan
This commit is contained in:
Coleen Phillimore 2015-06-04 08:05:47 -04:00
parent f3f4608e09
commit d97fc17132
5 changed files with 42 additions and 4 deletions

View file

@ -43,6 +43,7 @@
#include "runtime/deoptimization.hpp"
#include "runtime/relocator.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/events.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@ -174,6 +175,9 @@ void VM_RedefineClasses::doit_epilogue() {
// Free os::malloc allocated memory.
os::free(_scratch_classes);
// Reset the_class_oop to null for error printing.
_the_class_oop = NULL;
if (RC_TRACE_ENABLED(0x00000004)) {
// Used to have separate timers for "doit" and "all", but the timer
// overhead skewed the measurements.
@ -4105,6 +4109,13 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass,
java_lang_Class::classRedefinedCount(the_class_mirror),
os::available_memory() >> 10));
{
ResourceMark rm(THREAD);
Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
the_class->external_name(),
java_lang_Class::classRedefinedCount(the_class_mirror));
}
RC_TIMER_STOP(_timer_rsc_phase2);
} // end redefine_single_class()
@ -4249,3 +4260,11 @@ void VM_RedefineClasses::dump_methods() {
tty->cr();
}
}
void VM_RedefineClasses::print_on_error(outputStream* st) const {
VM_Operation::print_on_error(st);
if (_the_class_oop != NULL) {
ResourceMark rm;
st->print_cr(", redefining class %s", _the_class_oop->external_name());
}
}