changeset 877:10465dfbb1e9

profilers: perfasm, detect the absence of "perf" correctly
author shade
date Sun, 29 Jun 2014 23:51:17 +0400
parents 1a062c8f4734
children f860b4c92d13
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Sun Jun 29 23:38:58 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Sun Jun 29 23:51:17 2014 +0400
@@ -112,11 +112,11 @@
     private static final String SAVE_ASM_OUTPUT_TO_FILE = System.getProperty("jmh.perfasm.saveAsmToFile");
 
     private static final boolean IS_SUPPORTED;
-    private static final Collection<String> INIT_MSGS;
+    private static final Collection<String> FAIL_MSGS;
 
     static {
-        INIT_MSGS = tryWith("perf", "stat", "echo", "1");
-        IS_SUPPORTED = INIT_MSGS.isEmpty();
+        FAIL_MSGS = tryWith("perf", "stat", "echo", "1");
+        IS_SUPPORTED = FAIL_MSGS.isEmpty();
     }
 
     private String perfBinData;
@@ -159,7 +159,7 @@
 
     @Override
     public Collection<String> checkSupport() {
-        return IS_SUPPORTED ? INIT_MSGS : Collections.<String>emptyList();
+        return IS_SUPPORTED ? Collections.<String>emptyList() : FAIL_MSGS;
     }
 
     static Collection<String> tryWith(String... cmd) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java	Sun Jun 29 23:38:58 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java	Sun Jun 29 23:51:17 2014 +0400
@@ -54,11 +54,11 @@
 
     private static final boolean IS_SUPPORTED;
     private static final boolean IS_DELAYED;
-    private static final Collection<String> INIT_MSGS;
+    private static final Collection<String> FAIL_MSGS;
 
     static {
-        INIT_MSGS = tryWith("perf", "stat", "echo", "1");
-        IS_SUPPORTED = INIT_MSGS.isEmpty();
+        FAIL_MSGS = tryWith("perf", "stat", "echo", "1");
+        IS_SUPPORTED = FAIL_MSGS.isEmpty();
 
         Collection<String> delay = tryWith("perf", "stat", "-D 1", "echo", "1");
         IS_DELAYED = delay.isEmpty();
@@ -100,7 +100,7 @@
 
     @Override
     public Collection<String> checkSupport() {
-        return IS_SUPPORTED ? INIT_MSGS : Collections.<String>emptyList();
+        return IS_SUPPORTED ? Collections.<String>emptyList() : FAIL_MSGS;
     }
 
     private static Collection<String> tryWith(String... cmd) {