changeset 4783:7bfdc3edfe1a

8011064: Some tests have failed with SIGSEGV on arm-hflt on build b82 Summary: NMT_detail doesn't work on ARM because of missing frame pointers. Reviewed-by: dholmes, zgu
author jprovino
date Fri, 05 Jul 2013 10:18:53 -0400
parents 9a72ee84e61b
children 3a41a31ecbd7
files src/share/vm/services/memTracker.cpp src/share/vm/utilities/globalDefinitions.hpp
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/services/memTracker.cpp	Tue Jul 02 15:08:27 2013 -0700
+++ b/src/share/vm/services/memTracker.cpp	Fri Jul 05 10:18:53 2013 -0400
@@ -35,6 +35,7 @@
 #include "services/memReporter.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 
@@ -80,7 +81,15 @@
   if (strcmp(option_line, "=summary") == 0) {
     _tracking_level = NMT_summary;
   } else if (strcmp(option_line, "=detail") == 0) {
-    _tracking_level = NMT_detail;
+    // detail relies on a stack-walking ability that may not
+    // be available depending on platform and/or compiler flags
+    if (PLATFORM_NMT_DETAIL_SUPPORTED) {
+      _tracking_level = NMT_detail;
+    } else {
+      jio_fprintf(defaultStream::error_stream(),
+        "NMT detail is not supported on this platform.  Using NMT summary instead.\n");
+       _tracking_level = NMT_summary;
+    }
   } else if (strcmp(option_line, "=off") != 0) {
     vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
   }
--- a/src/share/vm/utilities/globalDefinitions.hpp	Tue Jul 02 15:08:27 2013 -0700
+++ b/src/share/vm/utilities/globalDefinitions.hpp	Fri Jul 05 10:18:53 2013 -0400
@@ -353,6 +353,14 @@
 # include "globalDefinitions_ppc.hpp"
 #endif
 
+/*
+ * If a platform does not support NMT_detail
+ * the platform specific globalDefinitions (above)
+ * can set PLATFORM_NMT_DETAIL_SUPPORTED to false
+ */
+#ifndef PLATFORM_NMT_DETAIL_SUPPORTED
+#define PLATFORM_NMT_DETAIL_SUPPORTED true
+#endif
 
 // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
 // Note: this value must be a power of 2