mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
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:
parent
a3b37b6372
commit
7294935e3e
5 changed files with 285 additions and 166 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue