Skip to content

[GR-64735] Record watchdog activity in NativeTextSectionImpl. #11134

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -99,6 +99,7 @@
import com.oracle.svm.core.option.SubstrateOptionsParser;
import com.oracle.svm.core.util.UserError;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.hosted.DeadlockWatchdog;
import com.oracle.svm.hosted.FeatureImpl;
import com.oracle.svm.hosted.NativeImageOptions;
import com.oracle.svm.hosted.c.CGlobalDataFeature;
Expand Down Expand Up @@ -921,6 +922,7 @@ private static void printSize(ImageHeapPartition partition) {
}

public abstract static class NativeTextSectionImpl extends BasicProgbitsSectionImpl {
DeadlockWatchdog watchdog = DeadlockWatchdog.singleton();

public static NativeTextSectionImpl factory(RelocatableBuffer relocatableBuffer, ObjectFile objectFile, NativeImageCodeCache codeCache) {
return codeCache.getTextSectionImpl(relocatableBuffer, objectFile, codeCache);
Expand Down Expand Up @@ -993,6 +995,7 @@ protected void writeTextSection(DebugContext debug, final Section textSection, f
final String symName = localSymbolNameForMethod(current);
final String signatureString = current.getUniqueShortName();
defineMethodSymbol(textSection, current, methodsBySignature, signatureString, symName, ImageLayerBuildingSupport.buildingSharedLayer(), pair.getRight());
watchdog.recordActivity();
}
// 2. fq without return type -- only for entry points!
for (Map.Entry<String, HostedMethod> ent : methodsBySignature.entrySet()) {
Expand All @@ -1016,6 +1019,7 @@ protected void writeTextSection(DebugContext debug, final Section textSection, f
defineMethodSymbol(cEntryData.getSymbolName(), true, textSection, method, codeCache.compilationResultFor(method));
}
}
watchdog.recordActivity();
}

// Write the text contents.
Expand Down