Skip to content

Commit

Permalink
Replaced removed Profiler with CPUSampler
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Sep 1, 2018
1 parent be079c2 commit 8a589d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion .classpath
Expand Up @@ -17,7 +17,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/com.oracle.truffle.object"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.oracle.truffle.object.basic"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.oracle.truffle.api.profiles"/>
<classpathentry kind="src" path="/com.oracle.truffle.tools"/>
<classpathentry kind="lib" path="libs/somns-deps-dev.jar" sourcepath="libs/somns-deps-source.jar"/>
<classpathentry kind="lib" path="libs/somns-deps.jar" sourcepath="libs/somns-deps-source.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/BlackDiamonds"/>
Expand Down
2 changes: 2 additions & 0 deletions build.xml
Expand Up @@ -13,7 +13,9 @@
<property name="graal.dir" location="${lib.dir}/truffle/compiler" />
<property name="truffle.dir" location="${lib.dir}/truffle/truffle" />
<property name="sdk.dir" location="${lib.dir}/truffle/sdk" />
<property name="tools.dir" location="${lib.dir}/truffle/tools" />
<property name="sdk.build" location="${sdk.dir}/mxbuild/dists" />
<property name="tools.build" location="${tools.dir}/mxbuild/dists" />
<property name="truffle.build" location="${truffle.dir}/mxbuild/dists" />
<property name="somns-deps.version" value="0.3.3" />
<property name="checkstyle.version" value="8.11" />
Expand Down
16 changes: 4 additions & 12 deletions src/som/VM.java
Expand Up @@ -18,8 +18,7 @@
import com.oracle.truffle.api.vm.PolyglotEngine.Builder;
import com.oracle.truffle.api.vm.PolyglotEngine.Value;
import com.oracle.truffle.api.vm.PolyglotRuntime.Instrument;
import com.oracle.truffle.tools.Profiler;
import com.oracle.truffle.tools.ProfilerInstrument;
import com.oracle.truffle.tools.profiler.CPUSampler;

import bd.inlining.InlinableNodes;
import coveralls.truffle.Coverage;
Expand Down Expand Up @@ -61,7 +60,7 @@ public final class VM {

@CompilationFinal private StructuralProbe structuralProbe;
@CompilationFinal private WebDebugger webDebugger;
@CompilationFinal private Profiler truffleProfiler;
@CompilationFinal private CPUSampler truffleProfiler;

private final ForkJoinPool actorPool;
private final ForkJoinPool forkJoinPool;
Expand Down Expand Up @@ -366,15 +365,8 @@ private void startExecution(final Builder builder) {
Map<String, ? extends Instrument> instruments = engine.getRuntime().getInstruments();

if (options.profilingEnabled) {
Instrument profiler = instruments.get(ProfilerInstrument.ID);
if (profiler == null) {
Output.errorPrintln("Truffle profiler not available. Might be a class path issue");
} else {
profiler.setEnabled(options.profilingEnabled);
truffleProfiler = Profiler.find(engine);
truffleProfiler.setCollecting(true);
truffleProfiler.setTiming(true);
}
truffleProfiler = CPUSampler.find(engine);
truffleProfiler.setCollecting(true);
}

Debugger debugger = null;
Expand Down

0 comments on commit 8a589d8

Please sign in to comment.