summaryrefslogtreecommitdiff
path: root/tools/profile_scalac
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-04 01:17:32 +0000
committerPaul Phillips <paulp@improving.org>2011-01-04 01:17:32 +0000
commit234ee6d56bdbf4234f8f6f0f2ebc0560f25701ee (patch)
tree336171608f51da71ef600db63b27b265c871b373 /tools/profile_scalac
parent266a2ca1c4ed1c655989c2435a9e83650b06f79a (diff)
downloadscala-234ee6d56bdbf4234f8f6f0f2ebc0560f25701ee.tar.gz
scala-234ee6d56bdbf4234f8f6f0f2ebc0560f25701ee.tar.bz2
scala-234ee6d56bdbf4234f8f6f0f2ebc0560f25701ee.zip
Some profiler changes.
after each phase, so all the allocations are partitionable by phase in the profiler. I also changed the name of -Yprofile-resident to -Yprofile-memory and had it snapshot after the run instead of between them, so it is usable for regular scalac usage as well. Added tools/profile_scalac which can be used as a drop-in replacement which handles some tedious setup. Review by dragos.
Diffstat (limited to 'tools/profile_scalac')
-rwxr-xr-xtools/profile_scalac25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/profile_scalac b/tools/profile_scalac
new file mode 100755
index 0000000000..f29b5b6fa4
--- /dev/null
+++ b/tools/profile_scalac
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# To influence behavior, you can set:
+#
+# YOURKIT_PATH
+# YOURKIT_PROFILE_PHASES
+# YNP_STARTUP_OPTIONS
+#
+
+# Start cpu sampling immediately
+DEFAULT_OPTS="sampling,onexit=snapshot"
+
+# Uses quick by default
+CLASSPATH=`tools/quickcp`
+
+AGENT=${YOURKIT_PATH:-/Applications/YourKit.app/bin/mac/libyjpagent.jnilib}
+OPTS=${YNP_STARTUP_OPTIONS:-$DEFAULT_OPTS}
+PHASES=${YOURKIT_PROFILE_PHASES:-all}
+
+java $JAVA_OPTS \
+ -classpath $CLASSPATH \
+ -agentpath:$AGENT=$OPTS \
+ scala.tools.nsc.Main -usejavacp \
+ -Yprofile:$PHASES \
+ "$@"