changeset 849:602b59b28289

profilers: perfasm, do not try to Long.valueOf speculatively, check for prefix first.
author shade
date Thu, 26 Jun 2014 23:50:07 +0400
parents 8e5540bb6ba7
children 002183c8326e
files jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 23:29:30 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 23:50:07 2014 +0400
@@ -588,7 +588,7 @@
                     if (elements.length == 7) {
                         method = elements[6].replace("'", "").replace("/", ".") + "::" + elements[3].replace("'", "") + "()";
                     }
-                } else if (elements.length >= 1) {
+                } else if (elements.length >= 1 && elements[0].startsWith("0x")) {
                     // Seems to be assembly line
                     try {
                         Long addr = Long.valueOf(elements[0].replace("0x", "").replace(":", ""), 16);
@@ -601,7 +601,7 @@
                             method = null;
                         }
                     } catch (NumberFormatException e) {
-                        lines.add(new ASMLine(line));
+                        throw new IllegalStateException("Should not be here", e);
                     }
                 } else {
                     lines.add(new ASMLine(line));
@@ -652,7 +652,7 @@
                         Long element = Long.valueOf(elements[4], 16);
                         evs.add(element);
                     } catch (NumberFormatException e) {
-                        // should it be kernel code?
+                        // TODO: Kernel addresses like "ffffffff810c1b00" overflow signed long
                     }
                 }
             }