changeset 1439:6d51e8e924d0

Linux perf should not assume cycles/instructions counters are always available
author shade
date Mon, 22 Jan 2018 17:50:08 +0100
parents e953411d3d5e
children ae08c0b9db44
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Wed Jan 17 11:53:49 2018 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Mon Jan 22 17:50:08 2018 +0100
@@ -44,7 +44,7 @@
     private OptionSpec<Long> optFrequency;
 
     public LinuxPerfAsmProfiler(String initLine) throws ProfilerException {
-        super(initLine, "cycles", "instructions");
+        super(initLine, "cycles");
 
         Collection<String> failMsg = Utils.tryWith(PerfSupport.PERF_EXEC, "stat", "--log-fd", "2", "echo", "1");
         if (!failMsg.isEmpty()) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Wed Jan 17 11:53:49 2018 +0100
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Mon Jan 22 17:50:08 2018 +0100
@@ -127,7 +127,7 @@
 
         if (supportedEvents.isEmpty()) {
             for (String ev : interestingEvents) {
-                Collection<String> res = Utils.tryWith(PerfSupport.PERF_EXEC, "stat", "--log-fd", "2", "--field-separator", ",", "--event", "cycles,instructions," + ev, "echo", "1");
+                Collection<String> res = Utils.tryWith(PerfSupport.PERF_EXEC, "stat", "--log-fd", "2", "--field-separator", ",", "--event", ev, "echo", "1");
                 if (res.isEmpty()) {
                     supportedEvents.add(ev);
                 }