changeset 982:f3a68bbd0f15

profilers: perfasm, able to switch the classload trace off, if that becomes a bottleneck.
author shade
date Mon, 25 Aug 2014 15:59:36 +0400
parents 2756664a5c82
children 7dd59a0f6d71
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Mon Aug 25 15:19:23 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Mon Aug 25 15:59:36 2014 +0400
@@ -143,6 +143,11 @@
      */
     private static final String SAVE_LOG_OUTPUT_TO_FILE = System.getProperty("jmh.perfasm.saveLogToFile");
 
+    /**
+     * Skip tracing the classloading events.
+     */
+    private static final Boolean SKIP_TRACE_CL = Boolean.getBoolean("jmh.perfasm.skipTraceClassload");
+
     private String hsLog;
     private String perfBinData;
     private String perfParsedData;
@@ -161,15 +166,18 @@
     @Override
     public Collection<String> addJVMOptions(BenchmarkParams params) {
         if (!SKIP_ASSEMBLY) {
-            return Arrays.asList(
+            Collection<String> opts = new ArrayList<String>();
+            opts.addAll(Arrays.asList(
                     "-XX:+UnlockDiagnosticVMOptions",
-                    "-XX:+TraceClassLoading",
                     "-XX:+LogCompilation",
                     "-XX:LogFile=" + hsLog,
                     "-XX:+PrintAssembly",
                     "-XX:+PrintCompilation",
-                    "-XX:+PrintInlining"
-            );
+                    "-XX:+PrintInlining"));
+            if (!SKIP_TRACE_CL) {
+                opts.add("-XX:+TraceClassLoading");
+            }
+            return opts;
         } else {
             return Collections.emptyList();
         }