class GCTraceCPUTime : public StackObj { bool _active; // true if times will be measured and printed double _starting_user_time; // user time at start of measurement double _starting_system_time; // system time at start of measurement double _starting_real_time; // real time at start of measurement
GCTracer* _tracer; public:
GCTraceCPUTime(GCTracer* tracer);
~GCTraceCPUTime();
};
class GCTimer;
// Callback to be invoked when the // GCTraceTimer goes in and out of scope. class TimespanCallback { public: virtualvoid at_start(Ticks start) = 0; virtualvoid at_end(Ticks end) = 0;
};
// Class used by the GCTraceTimer to to feed start and end ticks // when it goes in and out of scope. All callbacks get the same // start and end ticks. // // Example of callbacks: // Logging to unified loggingUnified Logging logger // Registering GCTimer phases class GCTraceTimeDriver : public StackObj { private: // An arbitrary number of callbacks - extend if needed
TimespanCallback* _cb0;
TimespanCallback* _cb1;
TimespanCallback* _cb2;
// Implements the GCTimer phase registration. Can be used when // GCTraceTime is used to register a sub-phase. The super-phase // determines the type (Pause or Concurrent). class GCTraceTimeTimer : public TimespanCallback { constchar* const _title;
GCTimer* const _timer;
// Implements GCTimer pause registration. Can be used // when the GCTraceTimer is used to report the top-level // pause phase. class GCTraceTimePauseTimer : public TimespanCallback { constchar* const _title;
GCTimer* const _timer;
// The GCTraceTime implementation class.It creates the normal // set of callbacks and installs them into the driver. When the // constructor is run the callbacks get the at_start call, and // when the destructor is run the callbacks get the at_end call. class GCTraceTimeImpl : public StackObj {
GCTraceTimeLoggerImpl _logger;
GCTraceTimeTimer _timer;
GCTraceTimeDriver _driver;
// Similar to GCTraceTimeImpl but is intended for concurrent phase logging, // which is a bit simpler and should always print the start line, i.e. not add the "start" tag. template <LogLevelType Level, LogTagType T0, LogTagType T1 = LogTag::__NO_TAG, LogTagType T2 = LogTag::__NO_TAG, LogTagType T3 = LogTag::__NO_TAG,
LogTagType T4 = LogTag::__NO_TAG, LogTagType GuardTag = LogTag::__NO_TAG> class GCTraceConcTimeImpl : public StackObj { private: bool _enabled;
jlong _start_time; constchar* _title; public:
GCTraceConcTimeImpl(constchar* title);
~GCTraceConcTimeImpl();
jlong start_time() { return _start_time; }
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.