Mercurial > hg > graal-jvmci-8
diff src/share/vm/trace/traceEvent.hpp @ 13400:86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
Reviewed-by: dholmes, egahlin
author | mgronlun |
---|---|
date | Sat, 23 Nov 2013 12:25:13 +0100 |
parents | f2110083203d |
children | 82d3e7b5277a |
line wrap: on
line diff
--- a/src/share/vm/trace/traceEvent.hpp Sat Nov 23 09:56:59 2013 +0100 +++ b/src/share/vm/trace/traceEvent.hpp Sat Nov 23 12:25:13 2013 +0100 @@ -25,26 +25,23 @@ #ifndef SHARE_VM_TRACE_TRACEEVENT_HPP #define SHARE_VM_TRACE_TRACEEVENT_HPP +#include "utilities/macros.hpp" + enum EventStartTime { UNTIMED, TIMED }; -#include "utilities/macros.hpp" - #if INCLUDE_TRACE #include "trace/traceBackend.hpp" #include "trace/tracing.hpp" #include "tracefiles/traceEventIds.hpp" #include "tracefiles/traceTypes.hpp" +#include "utilities/ticks.hpp" template<typename T> class TraceEvent : public StackObj { - protected: - jlong _startTime; - jlong _endTime; - private: bool _started; #ifdef ASSERT @@ -54,6 +51,18 @@ bool _ignore_check; #endif + protected: + jlong _startTime; + jlong _endTime; + + void set_starttime(const TracingTime& time) { + _startTime = time; + } + + void set_endtime(const TracingTime& time) { + _endTime = time; + } + public: TraceEvent(EventStartTime timing=TIMED) : _startTime(0), @@ -100,12 +109,12 @@ set_commited(); } - void set_starttime(jlong time) { - _startTime = time; + void set_starttime(const Ticks& time) { + _startTime = time.value(); } - void set_endtime(jlong time) { - _endTime = time; + void set_endtime(const Ticks& time) { + _endTime = time.value(); } TraceEventId id() const {