changeset 850:002183c8326e

profilers: perfasm, minor code move.
author shade
date Thu, 26 Jun 2014 23:52:00 +0400
parents 602b59b28289
children b5ddb0e98c8b
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 23:50:07 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 23:52:00 2014 +0400
@@ -263,18 +263,6 @@
             pw.println();
         }
 
-        if (SAVE_PERF_OUTPUT) {
-            String target = (SAVE_PERF_OUTPUT_TO_FILE == null) ?
-                    SAVE_PERF_OUTPUT_TO + "/" + params.id() + "-perf" :
-                    SAVE_PERF_OUTPUT_TO_FILE;
-            try {
-                FileUtils.copy(perfParsedData, target);
-                pw.println("Perf output saved to " + target);
-            } catch (IOException e) {
-                pw.println("Unable to save perf output to " + target);
-            }
-        }
-
         /**
          * 4. Figure out generated code regions
          */
@@ -381,6 +369,21 @@
         pw.println();
 
         /**
+         * Print perf output, if needed:
+         */
+        if (SAVE_PERF_OUTPUT) {
+            String target = (SAVE_PERF_OUTPUT_TO_FILE == null) ?
+                    SAVE_PERF_OUTPUT_TO + "/" + params.id() + "-perf" :
+                    SAVE_PERF_OUTPUT_TO_FILE;
+            try {
+                FileUtils.copy(perfParsedData, target);
+                pw.println("Perf output saved to " + target);
+            } catch (IOException e) {
+                pw.println("Unable to save perf output to " + target);
+            }
+        }
+
+        /**
          * Print annotated assembly, if needed:
          */
         if (SAVE_ASM_OUTPUT) {
@@ -405,9 +408,9 @@
                 pwAsm.flush();
                 asm.close();
 
-                pw.println("Annotated assembly saved to " + target);
+                pw.println("Perf-annotated assembly saved to " + target);
             } catch (IOException e) {
-                pw.println("Unable to save annotated assembly to " + target);
+                pw.println("Unable to save perf-annotated assembly to " + target);
             }
         }