8149023: Event based tracing should cover safepoint begin and end

Add events to safepoint begin and end

Reviewed-by: dholmes, mgronlun, egahlin
This commit is contained in:
David Simms 2016-03-23 10:52:35 +01:00
parent a3b37b6372
commit 7294935e3e
5 changed files with 285 additions and 166 deletions

View file

@ -32,6 +32,7 @@
#include "runtime/interfaceSupport.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/vmThread.hpp"
#include "runtime/vm_operations.hpp"
@ -352,14 +353,16 @@ void VMThread::evaluate_operation(VM_Operation* op) {
op->evaluate();
if (event.should_commit()) {
bool is_concurrent = op->evaluate_concurrently();
const bool is_concurrent = op->evaluate_concurrently();
const bool evaluate_at_safepoint = op->evaluate_at_safepoint();
event.set_operation(op->type());
event.set_safepoint(op->evaluate_at_safepoint());
event.set_safepoint(evaluate_at_safepoint);
event.set_blocking(!is_concurrent);
// Only write caller thread information for non-concurrent vm operations.
// For concurrent vm operations, the thread id is set to 0 indicating thread is unknown.
// This is because the caller thread could have exited already.
event.set_caller(is_concurrent ? 0 : THREAD_TRACE_ID(op->calling_thread()));
event.set_safepointId(evaluate_at_safepoint ? SafepointSynchronize::safepoint_counter() : 0);
event.commit();
}