mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
8228834: Regression caused by JDK-8214542 not installing complete checkpoint data to candidates
Reviewed-by: egahlin
This commit is contained in:
parent
7ca72d55c3
commit
946d2b3197
3 changed files with 15 additions and 16 deletions
|
@ -181,34 +181,33 @@ class SampleMark {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ObjectSampleCheckpoint::install(JfrCheckpointWriter& writer, bool class_unload) {
|
void ObjectSampleCheckpoint::install(JfrCheckpointWriter& writer, bool class_unload, bool type_set) {
|
||||||
if (!writer.has_data()) {
|
if (!writer.has_data()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(writer.has_data(), "invariant");
|
assert(writer.has_data(), "invariant");
|
||||||
const JfrCheckpointBlobHandle h_cp = writer.checkpoint_blob();
|
const JfrCheckpointBlobHandle h_cp = writer.checkpoint_blob();
|
||||||
|
CheckpointInstall install(h_cp);
|
||||||
|
|
||||||
// Class unload implies a safepoint.
|
// Class unload implies a safepoint.
|
||||||
// Not class unload implies the object sampler is locked, because it was claimed exclusively earlier.
|
// Not class unload implies the object sampler is locked, because it was claimed exclusively earlier.
|
||||||
// Therefore: direct access the object sampler instance is safe.
|
// Therefore: direct access the object sampler instance is safe.
|
||||||
const ObjectSampler* const object_sampler = ObjectSampler::sampler();
|
ObjectSampler* const object_sampler = ObjectSampler::sampler();
|
||||||
assert(object_sampler != NULL, "invariant");
|
assert(object_sampler != NULL, "invariant");
|
||||||
|
|
||||||
ObjectSample* const last = const_cast<ObjectSample*>(object_sampler->last());
|
ObjectSample* const last = const_cast<ObjectSample*>(object_sampler->last());
|
||||||
const ObjectSample* const last_resolved = object_sampler->last_resolved();
|
const ObjectSample* const last_resolved = object_sampler->last_resolved();
|
||||||
CheckpointInstall install(h_cp);
|
|
||||||
|
|
||||||
if (class_unload) {
|
// install only to new samples since last resolved checkpoint
|
||||||
// all samples need class unload information
|
|
||||||
do_samples(last, NULL, install);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// only new samples since last resolved checkpoint
|
|
||||||
if (last != last_resolved) {
|
if (last != last_resolved) {
|
||||||
do_samples(last, last_resolved, install);
|
do_samples(last, last_resolved, install);
|
||||||
const_cast<ObjectSampler*>(object_sampler)->set_last_resolved(last);
|
if (class_unload) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (type_set) {
|
||||||
|
object_sampler->set_last_resolved(last);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +288,6 @@ bool WriteObjectSampleStacktrace::process() {
|
||||||
JfrStackTraceRepository::write_metadata(writer);
|
JfrStackTraceRepository::write_metadata(writer);
|
||||||
|
|
||||||
// install the stacktrace checkpoint information to the candidates
|
// install the stacktrace checkpoint information to the candidates
|
||||||
ObjectSampleCheckpoint::install(writer, false);
|
ObjectSampleCheckpoint::install(writer, false, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ObjectSampler;
|
||||||
|
|
||||||
class ObjectSampleCheckpoint : AllStatic {
|
class ObjectSampleCheckpoint : AllStatic {
|
||||||
public:
|
public:
|
||||||
static void install(JfrCheckpointWriter& writer, bool class_unload);
|
static void install(JfrCheckpointWriter& writer, bool class_unload, bool type_set);
|
||||||
static void write(ObjectSampler* sampler, EdgeStore* edge_store, bool emit_all, Thread* thread);
|
static void write(ObjectSampler* sampler, EdgeStore* edge_store, bool emit_all, Thread* thread);
|
||||||
static int mark(ObjectSampler* sampler, ObjectSampleMarker& marker, bool emit_all);
|
static int mark(ObjectSampler* sampler, ObjectSampleMarker& marker, bool emit_all);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -311,7 +311,7 @@ void ClassUnloadTypeSet::serialize(JfrCheckpointWriter& writer) {
|
||||||
if (LeakProfiler::is_running()) {
|
if (LeakProfiler::is_running()) {
|
||||||
JfrCheckpointWriter leakp_writer(false, true, Thread::current());
|
JfrCheckpointWriter leakp_writer(false, true, Thread::current());
|
||||||
type_set.write(writer, &leakp_writer);
|
type_set.write(writer, &leakp_writer);
|
||||||
ObjectSampleCheckpoint::install(leakp_writer, true);
|
ObjectSampleCheckpoint::install(leakp_writer, true, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type_set.write(writer, NULL);
|
type_set.write(writer, NULL);
|
||||||
|
@ -322,7 +322,7 @@ void TypeSet::serialize(JfrCheckpointWriter& writer) {
|
||||||
if (LeakProfiler::is_running()) {
|
if (LeakProfiler::is_running()) {
|
||||||
JfrCheckpointWriter leakp_writer(false, true, Thread::current());
|
JfrCheckpointWriter leakp_writer(false, true, Thread::current());
|
||||||
type_set.write(writer, &leakp_writer);
|
type_set.write(writer, &leakp_writer);
|
||||||
ObjectSampleCheckpoint::install(leakp_writer, false);
|
ObjectSampleCheckpoint::install(leakp_writer, false, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
type_set.write(writer, NULL);
|
type_set.write(writer, NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue