changeset 871:0324ede438ef

profilers: perfasm, gracefully recover when non-address lines are read.
author shade
date Fri, 27 Jun 2014 19:59:32 +0400
parents 5fc2244b5815
children 0060fbb99146
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Jun 27 19:29:39 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Fri Jun 27 19:59:32 2014 +0400
@@ -534,7 +534,7 @@
                         method = elements[6].replace("'", "").replace("/", ".") + "::" + elements[3].replace("'", "");
                     }
                 } else if (elements.length >= 1 && elements[0].startsWith("0x")) {
-                    // Seems to be assembly line
+                    // Seems to be line with address.
                     try {
                         Long addr = Long.valueOf(elements[0].replace("0x", "").replace(":", ""), 16);
                         int idx = lines.size();
@@ -546,7 +546,8 @@
                             method = null;
                         }
                     } catch (NumberFormatException e) {
-                        throw new IllegalStateException("Should not be here", e);
+                        // Nope, not the address line.
+                        lines.add(new ASMLine(line));
                     }
                 } else {
                     lines.add(new ASMLine(line));