changeset 854:188235b20cf8

profilers: perfasm, adjustable sampling frequency.
author shade
date Fri, 27 Jun 2014 01:25:02 +0400
parents 1427b5899632
children a237f41d71be
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Jun 27 01:11:21 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Jun 27 01:25:02 2014 +0400
@@ -83,6 +83,9 @@
     /** Delay collection for given time; -1 to detect automatically */
     private static final int DELAY_MSEC = Integer.getInteger("jmh.perfasm.delayMs", -1);
 
+    /** Sampling frequency */
+    private static final long SAMPLE_FREQUENCY = Long.getLong("jmh.perfasm.frequency", 1000);
+
     /** Save perf output to file? */
     private static final Boolean SAVE_PERF_OUTPUT = Boolean.getBoolean("jmh.perfasm.savePerf");
 
@@ -119,7 +122,7 @@
 
     @Override
     public Collection<String> addJVMInvokeOptions(BenchmarkParams params) {
-        return Arrays.asList("perf", "record", "-c 100000", "-e " + Utils.join(EVENTS, ","), "-o" + perfBinData);
+        return Arrays.asList("perf", "record", "-F " + SAMPLE_FREQUENCY, "-e " + Utils.join(EVENTS, ","), "-o" + perfBinData);
     }
 
     @Override