Skip to content

Commit 8c9f410

Browse files
committed
[GR-45097] Record queryCode compilation as DeadlockWatchdog activity.
PullRequest: graal/14129
2 parents 770da72 + 2f3d084 commit 8c9f410

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ protected void processNativeLibraryImports(NativeLibraries nativeLibs, MetaAcces
17091709
}
17101710
nativeLibs.processCLibraryAnnotations(loader);
17111711

1712-
nativeLibs.finish();
1712+
nativeLibs.finish(loader);
17131713
nativeLibs.reportErrors();
17141714
}
17151715

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/CAnnotationProcessor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import java.util.ArrayList;
3535
import java.util.List;
3636

37-
import com.oracle.svm.hosted.c.libc.HostedLibCBase;
3837
import org.graalvm.nativeimage.ImageSingletons;
3938
import org.graalvm.nativeimage.Platform;
4039

@@ -43,10 +42,12 @@
4342
import com.oracle.svm.core.util.InterruptImageBuilding;
4443
import com.oracle.svm.core.util.UserError;
4544
import com.oracle.svm.core.util.VMError;
45+
import com.oracle.svm.hosted.ImageClassLoader;
4646
import com.oracle.svm.hosted.c.codegen.CCompilerInvoker;
4747
import com.oracle.svm.hosted.c.codegen.QueryCodeWriter;
4848
import com.oracle.svm.hosted.c.info.InfoTreeBuilder;
4949
import com.oracle.svm.hosted.c.info.NativeCodeInfo;
50+
import com.oracle.svm.hosted.c.libc.HostedLibCBase;
5051
import com.oracle.svm.hosted.c.query.QueryResultParser;
5152
import com.oracle.svm.hosted.c.query.RawStructureLayoutPlanner;
5253
import com.oracle.svm.hosted.c.query.SizeAndSignednessVerifier;
@@ -83,7 +84,7 @@ public CAnnotationProcessor(NativeLibraries nativeLibs, NativeCodeContext codeCt
8384
}
8485
}
8586

86-
public NativeCodeInfo process(CAnnotationProcessorCache cache) {
87+
public NativeCodeInfo process(CAnnotationProcessorCache cache, ImageClassLoader loader) {
8788
InfoTreeBuilder constructor = new InfoTreeBuilder(nativeLibs, codeCtx);
8889
codeInfo = constructor.construct();
8990
if (nativeLibs.getErrors().size() > 0) {
@@ -108,8 +109,8 @@ public NativeCodeInfo process(CAnnotationProcessorCache cache) {
108109
// Only output query code and exit
109110
return codeInfo;
110111
}
111-
112112
Path binary = compileQueryCode(queryFile);
113+
loader.watchdog.recordActivity();
113114
if (nativeLibs.getErrors().size() > 0) {
114115
return codeInfo;
115116
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/NativeLibraries.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,13 @@ private Class<? extends CContext.Directives> getDirectives(ResolvedJavaType type
550550
}
551551
}
552552

553-
public void finish() {
553+
public void finish(ImageClassLoader loader) {
554554
libraryPaths.addAll(SubstrateOptions.CLibraryPath.getValue().values().stream().map(Path::toString).collect(Collectors.toList()));
555555
for (NativeCodeContext context : compilationUnitToContext.values()) {
556556
if (context.isInConfiguration()) {
557557
libraries.addAll(context.getDirectives().getLibraries());
558558
libraryPaths.addAll(context.getDirectives().getLibraryPaths());
559-
new CAnnotationProcessor(this, context).process(cache);
559+
new CAnnotationProcessor(this, context).process(cache, loader);
560560
}
561561
}
562562
}

0 commit comments

Comments
 (0)