< prev index next >

src/hotspot/share/gc/shared/collectorCounters.hpp

Print this page




  54     }
  55 
  56     inline PerfCounter* invocation_counter() const  { return _invocations; }
  57 
  58     inline PerfCounter* time_counter() const        { return _time; }
  59 
  60     inline PerfVariable* last_entry_counter() const { return _last_entry_time; }
  61 
  62     inline PerfVariable* last_exit_counter() const  { return _last_exit_time; }
  63 
  64     const char* name_space() const                  { return _name_space; }
  65 };
  66 
  67 class TraceCollectorStats: public PerfTraceTimedEvent {
  68 
  69   protected:
  70     CollectorCounters* _c;
  71 
  72   public:
  73     inline TraceCollectorStats(CollectorCounters* c) :
  74            PerfTraceTimedEvent(c->time_counter(), c->invocation_counter()),

  75            _c(c) {
  76 
  77       if (UsePerfData) {
  78          _c->last_entry_counter()->set_value(os::elapsed_counter());
  79       }
  80     }
  81 
  82     inline ~TraceCollectorStats() {
  83       if (UsePerfData) _c->last_exit_counter()->set_value(os::elapsed_counter());


  84     }
  85 };
  86 
  87 #endif // SHARE_VM_GC_SHARED_COLLECTORCOUNTERS_HPP


  54     }
  55 
  56     inline PerfCounter* invocation_counter() const  { return _invocations; }
  57 
  58     inline PerfCounter* time_counter() const        { return _time; }
  59 
  60     inline PerfVariable* last_entry_counter() const { return _last_entry_time; }
  61 
  62     inline PerfVariable* last_exit_counter() const  { return _last_exit_time; }
  63 
  64     const char* name_space() const                  { return _name_space; }
  65 };
  66 
  67 class TraceCollectorStats: public PerfTraceTimedEvent {
  68 
  69   protected:
  70     CollectorCounters* _c;
  71 
  72   public:
  73     inline TraceCollectorStats(CollectorCounters* c) :
  74            PerfTraceTimedEvent((c == NULL) ? NULL : c->time_counter(),
  75                                (c == NULL) ? NULL : c->invocation_counter()),
  76            _c(c) {
  77 
  78       if (UsePerfData && (_c != NULL)) {
  79          _c->last_entry_counter()->set_value(os::elapsed_counter());
  80       }
  81     }
  82 
  83     inline ~TraceCollectorStats() {
  84       if (UsePerfData && (_c != NULL)) {
  85         _c->last_exit_counter()->set_value(os::elapsed_counter());
  86       }
  87     }
  88 };
  89 
  90 #endif // SHARE_VM_GC_SHARED_COLLECTORCOUNTERS_HPP
< prev index next >