8134607: Remove per-compiler performance counters
authorredestad
Mon, 12 Oct 2015 14:54:39 +0200
changeset 33168 20f107826ae8
parent 33167 6437daa39853
child 33169 d9dc5d6fdb31
8134607: Remove per-compiler performance counters Reviewed-by: twisti, neliasso
hotspot/src/share/vm/compiler/compileBroker.cpp
hotspot/src/share/vm/compiler/compileBroker.hpp
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Oct 09 21:04:19 2015 +0000
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Mon Oct 12 14:54:39 2015 +0200
@@ -458,41 +458,9 @@
   print(tty);
 }
 
-CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
-
+CompilerCounters::CompilerCounters() {
   _current_method[0] = '\0';
   _compile_type = CompileBroker::no_compile;
-
-  if (UsePerfData) {
-    ResourceMark rm;
-
-    // create the thread instance name space string - don't create an
-    // instance subspace if instance is -1 - keeps the adapterThread
-    // counters  from having a ".0" namespace.
-    const char* thread_i = (instance == -1) ? thread_name :
-                      PerfDataManager::name_space(thread_name, instance);
-
-
-    char* name = PerfDataManager::counter_name(thread_i, "method");
-    _perf_current_method =
-               PerfDataManager::create_string_variable(SUN_CI, name,
-                                                       cmname_buffer_length,
-                                                       _current_method, CHECK);
-
-    name = PerfDataManager::counter_name(thread_i, "type");
-    _perf_compile_type = PerfDataManager::create_variable(SUN_CI, name,
-                                                          PerfData::U_None,
-                                                         (jlong)_compile_type,
-                                                          CHECK);
-
-    name = PerfDataManager::counter_name(thread_i, "time");
-    _perf_time = PerfDataManager::create_counter(SUN_CI, name,
-                                                 PerfData::U_Ticks, CHECK);
-
-    name = PerfDataManager::counter_name(thread_i, "compiles");
-    _perf_compiles = PerfDataManager::create_counter(SUN_CI, name,
-                                                     PerfData::U_Events, CHECK);
-  }
 }
 
 // ------------------------------------------------------------------
@@ -765,7 +733,7 @@
   for (int i = 0; i < c2_compiler_count; i++) {
     // Create a name for our thread.
     sprintf(name_buffer, "%s CompilerThread%d", _compilers[1]->name(), i);
-    CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
+    CompilerCounters* counters = new CompilerCounters();
     // Shark and C2
     make_thread(name_buffer, _c2_compile_queue, counters, _compilers[1], compiler_thread, CHECK);
   }
@@ -773,7 +741,7 @@
   for (int i = c2_compiler_count; i < compiler_count; i++) {
     // Create a name for our thread.
     sprintf(name_buffer, "C1 CompilerThread%d", i);
-    CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
+    CompilerCounters* counters = new CompilerCounters();
     // C1
     make_thread(name_buffer, _c1_compile_queue, counters, _compilers[0], compiler_thread, CHECK);
   }
@@ -1514,10 +1482,6 @@
       os::hint_no_preempt();
     }
 
-    // trace per thread time and compile statistics
-    CompilerCounters* counters = ((CompilerThread*)thread)->counters();
-    PerfTraceTimedEvent(counters->time_counter(), counters->compile_counter());
-
     // Assign the task to the current thread.  Mark this compilation
     // thread as active for the profiler.
     CompileTaskWrapper ctw(task);
--- a/hotspot/src/share/vm/compiler/compileBroker.hpp	Fri Oct 09 21:04:19 2015 +0000
+++ b/hotspot/src/share/vm/compiler/compileBroker.hpp	Mon Oct 12 14:54:39 2015 +0200
@@ -48,36 +48,26 @@
   private:
 
     char _current_method[cmname_buffer_length];
-    PerfStringVariable* _perf_current_method;
-
     int  _compile_type;
-    PerfVariable* _perf_compile_type;
-
-    PerfCounter* _perf_time;
-    PerfCounter* _perf_compiles;
 
   public:
-    CompilerCounters(const char* name, int instance, TRAPS);
+    CompilerCounters();
 
     // these methods should be called in a thread safe context
 
     void set_current_method(const char* method) {
       strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
       _current_method[cmname_buffer_length-1] = '\0';
-      if (UsePerfData) _perf_current_method->set_value(method);
     }
 
     char* current_method()                  { return _current_method; }
 
     void set_compile_type(int compile_type) {
       _compile_type = compile_type;
-      if (UsePerfData) _perf_compile_type->set_value((jlong)compile_type);
     }
 
     int compile_type()                       { return _compile_type; }
 
-    PerfCounter* time_counter()              { return _perf_time; }
-    PerfCounter* compile_counter()           { return _perf_compiles; }
 };
 
 // CompileQueue