changeset 18534:fa981f5bb53a

reenable -XX:+GraalCountersExcludeCompiler option
author Lukas Stadler <lukas.stadler@oracle.com>
date Sun, 23 Nov 2014 12:58:18 -0800
parents 25a21e1794ec
children 11f353f259ae
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java src/share/vm/runtime/thread.cpp
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java	Wed Nov 26 17:14:49 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java	Sun Nov 23 12:58:18 2014 -0800
@@ -57,7 +57,7 @@
     private static final String GROUP_NAME_WITHOUT = "~profiled weight (invoke-free sections)";
     private static final String GROUP_NAME_INVOKES = "~profiled invokes";
 
-    private static final boolean WITH_SECTION_HEADER = false;
+    private static final boolean WITH_SECTION_HEADER = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_SECTION_HEADER", "false"));
     private static final boolean WITH_INVOKE_FREE_SECTIONS = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_FREE_SECTIONS", "false"));
     private static final boolean WITH_INVOKES = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_INVOKES", "true"));
 
--- a/src/share/vm/runtime/thread.cpp	Wed Nov 26 17:14:49 2014 +0100
+++ b/src/share/vm/runtime/thread.cpp	Sun Nov 23 12:58:18 2014 -0800
@@ -1431,8 +1431,9 @@
 
 jlong* JavaThread::_graal_old_thread_counters;
 
-bool graal_counters_include(oop threadObj) {
-  return !GraalCountersExcludeCompiler || threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass();
+bool graal_counters_include(JavaThread* thread) {
+  oop threadObj = thread->threadObj();
+  return !GraalCountersExcludeCompiler || (!thread->is_Compiler_thread() && (threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass()));
 }
 
 void JavaThread::collect_counters(typeArrayOop array) {
@@ -1442,7 +1443,7 @@
       array->long_at_put(i, _graal_old_thread_counters[i]);
     }
     for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) {
-      if (graal_counters_include(tp->threadObj())) {
+      if (graal_counters_include(tp)) {
         for (int i = 0; i < array->length(); i++) {
           array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]);
         }
@@ -1696,7 +1697,7 @@
 
 #ifdef GRAAL
   if (GraalCounterSize > 0) {
-    if (graal_counters_include(threadObj())) {
+    if (graal_counters_include(this)) {
       for (int i = 0; i < GraalCounterSize; i++) {
         _graal_old_thread_counters[i] += _graal_counters[i];
       }