# HG changeset patch # User egahlin # Date 1508185361 0 # Node ID 1c21c60f51bf7c9743b52e0831f17d6b8017bd3f # Parent 0c2e1f8eccaa3b0e3f1730f8a4c4f7a4baae42dc# Parent a91c094bcaa48ba1cb125d76b4b372d2a233507f Merge diff -r a91c094bcaa4 -r 1c21c60f51bf src/hotspot/share/runtime/biasedLocking.cpp --- a/src/hotspot/share/runtime/biasedLocking.cpp Mon Oct 16 19:11:17 2017 +0000 +++ b/src/hotspot/share/runtime/biasedLocking.cpp Mon Oct 16 20:22:41 2017 +0000 @@ -35,6 +35,7 @@ #include "runtime/vframe.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" +#include "trace/tracing.hpp" static bool _biased_locking_enabled = false; BiasedLockingCounters BiasedLocking::_counters; @@ -643,23 +644,43 @@ // stale epoch. ResourceMark rm; log_info(biasedlocking)("Revoking bias by walking my own stack:"); + EventBiasedLockSelfRevocation event; BiasedLocking::Condition cond = revoke_bias(obj(), false, false, (JavaThread*) THREAD); ((JavaThread*) THREAD)->set_cached_monitor_info(NULL); assert(cond == BIAS_REVOKED, "why not?"); + if (event.should_commit()) { + event.set_lockClass(k); + event.commit(); + } return cond; } else { + EventBiasedLockRevocation event; VM_RevokeBias revoke(&obj, (JavaThread*) THREAD); VMThread::execute(&revoke); + if (event.should_commit() && (revoke.status_code() != NOT_BIASED)) { + event.set_lockClass(k); + // Subtract 1 to match the id of events committed inside the safepoint + event.set_safepointId(SafepointSynchronize::safepoint_counter() - 1); + event.commit(); + } return revoke.status_code(); } } assert((heuristics == HR_BULK_REVOKE) || (heuristics == HR_BULK_REBIAS), "?"); + EventBiasedLockClassRevocation event; VM_BulkRevokeBias bulk_revoke(&obj, (JavaThread*) THREAD, (heuristics == HR_BULK_REBIAS), attempt_rebias); VMThread::execute(&bulk_revoke); + if (event.should_commit()) { + event.set_revokedClass(obj->klass()); + event.set_disableBiasing((heuristics != HR_BULK_REBIAS)); + // Subtract 1 to match the id of events committed inside the safepoint + event.set_safepointId(SafepointSynchronize::safepoint_counter() - 1); + event.commit(); + } return bulk_revoke.status_code(); } diff -r a91c094bcaa4 -r 1c21c60f51bf src/hotspot/share/trace/traceevents.xml --- a/src/hotspot/share/trace/traceevents.xml Mon Oct 16 19:11:17 2017 +0000 +++ b/src/hotspot/share/trace/traceevents.xml Mon Oct 16 20:22:41 2017 +0000 @@ -104,6 +104,24 @@ + + + + + + + + + + + + + + +