Skip to content

Commit 2ca91e9

Browse files
committed
[GR-65807] Clarify which exact native agents are unsupported.
PullRequest: graal/21075
2 parents e370690 + 1572177 commit 2ca91e9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/runtime/AgentLibraries.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.graalvm.options.OptionMap;
3333

3434
import com.oracle.truffle.api.CompilerDirectives;
35+
import com.oracle.truffle.api.TruffleLogger;
3536
import com.oracle.truffle.api.interop.ArityException;
3637
import com.oracle.truffle.api.interop.InteropLibrary;
3738
import com.oracle.truffle.api.interop.TruffleObject;
@@ -129,6 +130,14 @@ private TruffleObject lookupOnLoad(AgentLibrary agent) {
129130
return getNativeAccess().lookupAndBindSymbol(library, AGENT_ONLOAD, ONLOAD_SIGNATURE, true, true);
130131
}
131132

133+
public void noSupportWarning(TruffleLogger logger) {
134+
assert !agents.isEmpty();
135+
logger.warning("Native agent support is currently disabled in Espresso.");
136+
for (AgentLibrary agent : agents) {
137+
logger.warning("Ignoring passed native agent: " + agent.name);
138+
}
139+
}
140+
132141
private static class AgentLibrary {
133142

134143
final String name;
@@ -143,6 +152,5 @@ private static class AgentLibrary {
143152
this.options = options;
144153
this.isAbsolutePath = isAbsolutePath;
145154
}
146-
147155
}
148156
}

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/runtime/EspressoContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ private void spawnVM() throws ContextPatchingException {
451451
registries.getBootClassRegistry().initUnnamedModule(null);
452452
}
453453
javaAgentsOnLoad();
454-
initializeAgents();
454+
initializeNativeAgents();
455455

456456
try (DebugCloseable metaInit = META_INIT.scope(espressoEnv.getTimers())) {
457457
this.meta = new Meta(this);
@@ -725,7 +725,7 @@ private void javaAgentsOnLoad() {
725725
}
726726
}
727727

728-
private void initializeAgents() {
728+
private void initializeNativeAgents() {
729729
agents = new AgentLibraries(this);
730730
if (getEnv().getOptions().hasBeenSet(EspressoOptions.AgentLib)) {
731731
agents.registerAgents(getEnv().getOptions().get(EspressoOptions.AgentLib), false);
@@ -737,7 +737,7 @@ private void initializeAgents() {
737737
agents.initialize();
738738
} else {
739739
if (!agents.isEmpty()) {
740-
getLogger().warning("Agents support is currently disabled in Espresso. Ignoring passed agent options.");
740+
agents.noSupportWarning(getLogger());
741741
}
742742
}
743743
}

0 commit comments

Comments
 (0)