Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-54568] Record more activity in buildRuntimeMetadata(). #10362

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void addFrameSlice(FrameData data, List<CompressedFrameData> slice) {
sliceFrequency.addObject(frameSliceIndex);
}

void encodeCompressedData(UnsafeArrayTypeWriter encodingBuffer, Encoders encoders) {
void encodeCompressedData(Runnable recordActivity, UnsafeArrayTypeWriter encodingBuffer, Encoders encoders) {
assert !sealed : "already sealed";
sealed = true;

Expand Down Expand Up @@ -332,6 +332,7 @@ void encodeCompressedData(UnsafeArrayTypeWriter encodingBuffer, Encoders encoder
uniqueSuccessorIndex = NO_SUCCESSOR_INDEX_MARKER;
}
encodeCompressedFrame(encodingBuffer, encoders, frame, uniqueSuccessorIndex);
recordActivity.run();
}

/*
Expand Down Expand Up @@ -901,7 +902,7 @@ private static void afterInstallation(CodeInfo info) {

private NonmovableArray<Byte> encodeFrameDatas(Runnable recordActivity) {
UnsafeArrayTypeWriter encodingBuffer = UnsafeArrayTypeWriter.create(ByteArrayReader.supportsUnalignedMemoryAccess());
frameMetadata.encodeCompressedData(encodingBuffer, encoders);
frameMetadata.encodeCompressedData(recordActivity, encodingBuffer, encoders);
for (FrameData data : allDebugInfos) {
if (data.frameSliceIndex == UNCOMPRESSED_FRAME_SLICE_INDEX) {
data.encodedFrameInfoIndex = encodingBuffer.getBytesWritten();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ protected void buildRuntimeMetadata(DebugContext debug, SnippetReflectionProvide
}
}

watchdog.recordActivity();

if (SubstrateOptions.IncludeMethodData.getValue()) {
for (HostedField field : hUniverse.getFields()) {
if (field.isAccessed() && !field.getWrapped().isInBaseLayer() && !includedFields.contains(field.getWrapped())) {
Expand Down