Profiling a Truffle language

Stefan Marr java at stefan-marr.de
Sun Jul 31 10:13:47 UTC 2016


Hi Gerard:


> On 31 Jul 2016, at 11:45, Gerard Krol <gerard at gerardkrol.nl> wrote:
> 
> What I'd like to have is a simple profiler (preferably one using sampling),
> that will point me to the actual slow statements in the source program. Is
> something like that available or will I have to write something myself? In
> the last case, I suppose I should be using the the Truffle Instrumentation
> API[2]?

There is a profiler already in the instrumentation framework.
I am not entirely sure, but I think the class is now named Profiler.
Things seem to have changed.

I am using it in SOMns: https://github.com/smarr/SOMns/blob/master/src/som/VM.java#L329
And I wrote some related notes up here: http://stefan-marr.de/2016/04/adding-debugging-support-to-a-truffle-language/

For the profiler, you’ll need to tag some node in each method as Root (RootTag: https://github.com/graalvm/truffle/blob/master/truffle/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/StandardTags.java#L87) Or perhaps easier to find in the SimpleLanguage: https://github.com/graalvm/truffle/blob/master/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLStatementNode.java#L99

Hope that gets you started.

Best regards
Stefan




-- 
Stefan Marr
Johannes Kepler Universität Linz
http://stefan-marr.de/research/





More information about the graal-dev mailing list