changeset 1261:0c56a3867bd7

7901482: perfnorm profiler stops reporting anything after 1.10.3 release
author shade
date Thu, 13 Aug 2015 17:55:46 +0300
parents d9fc8a523df3
children 3adb58795226
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java
diffstat 1 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Thu Aug 13 15:48:02 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfNormProfiler.java	Thu Aug 13 17:55:46 2015 +0300
@@ -204,6 +204,8 @@
 
             long delayNs = getDelay(br);
 
+            NumberFormat nf = NumberFormat.getInstance();
+
             String line;
 
             nextline:
@@ -213,15 +215,27 @@
                 if (isIncrementable) {
                     String[] split = line.split(",");
 
-                    // Malformed line, ignore
-                    if (split.length < 4) continue nextline;
+                    String time;
+                    String count;
+                    String event;
 
-                    String time  = split[0].trim();
-                    String count = split[1].trim();
-                    String event = split[3].trim();
+                    if (split.length == 3) {
+                        // perf 3.13: time,count,event
+                        time  = split[0].trim();
+                        count = split[1].trim();
+                        event = split[2].trim();
+                    } else if (split.length >= 4) {
+                        // perf >3.13: time,count,<other>,event,<others>
+                        time  = split[0].trim();
+                        count = split[1].trim();
+                        event = split[3].trim();
+                    } else {
+                        // Malformed line, ignore
+                        continue nextline;
+                    }
 
                     try {
-                        double timeSec = NumberFormat.getInstance().parse(time).doubleValue();
+                        double timeSec = nf.parse(time).doubleValue();
                         if (timeSec * TimeUnit.SECONDS.toNanos(1) < delayNs) {
                             // warmup, ignore
                             continue nextline;
@@ -232,7 +246,7 @@
                     }
 
                     try {
-                        long lValue = NumberFormat.getInstance().parse(count).longValue();
+                        long lValue = nf.parse(count).longValue();
                         if (lValue > highPassFilter) {
                             // anomalous value, pretend we did not see it
                             continue nextline;
@@ -253,7 +267,7 @@
                     String event = line.substring(idx + 1).trim();
 
                     try {
-                        long lValue = NumberFormat.getInstance().parse(count).longValue();
+                        long lValue = nf.parse(count).longValue();
                         events.add(event, lValue);
                     } catch (ParseException e) {
                         // do nothing, continue