changeset 1034:8b8583c12c66

Partially revert dso/sym order after 7901100 change. This fixes the native library treatment.
author shade
date Fri, 14 Nov 2014 00:58:31 +0300
parents fb2e412863df
children db42cb5e9439
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Nov 14 00:29:05 2014 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Nov 14 00:58:31 2014 +0300
@@ -240,7 +240,7 @@
          */
 
         try {
-            Process p = Runtime.getRuntime().exec("perf script -f time,event,ip,dso,sym -i " + perfBinData);
+            Process p = Runtime.getRuntime().exec("perf script -f time,event,ip,sym,dso -i " + perfBinData);
 
             // drain streams, else we might lock up
             FileOutputStream fos = new FileOutputStream(perfParsedData);
@@ -734,7 +734,7 @@
             // lots of performance, so we need to get tricky, and merge the symbol names back
             // after splitting.
             //
-            // We are forcing perf to print: time event ip dso sym
+            // We are forcing perf to print: time event ip sym dso
             //
 
             String line;
@@ -743,13 +743,13 @@
 
                 String[] elems = line.trim().split("[ ]+");
 
-                if (elems.length < 5) continue;
+                if (elems.length < 4) continue;
 
                 String strTime = elems[0].replace(":", "");
                 String evName = elems[1].replace(":", "");
                 String strAddr = elems[2];
-                String lib = elems[3];
-                String symbol = Utils.join(Arrays.copyOfRange(elems, 4, elems.length), " ");
+                String symbol = Utils.join(Arrays.copyOfRange(elems, 3, elems.length - 1), " ");
+                String lib = elems[elems.length - 1];
                 lib = lib.substring(lib.lastIndexOf("/") + 1, lib.length()).replace("(", "").replace(")", "");
 
                 try {