/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_TRACE_TRACEEVENT_HPP
#define SHARE_VM_TRACE_TRACEEVENT_HPP
enum EventStartTime {
};
#if INCLUDE_TRACE
#include "trace/traceBackend.hpp"
#include "trace/tracing.hpp"
#include "tracefiles/traceEventIds.hpp"
#include "tracefiles/traceTypes.hpp"
template<typename T>
protected:
private:
bool _started;
#ifdef ASSERT
bool _committed;
bool _cancelled;
protected:
bool _ignore_check;
#endif
public:
_startTime(0),
_endTime(0),
_started(false)
#ifdef ASSERT
,
_committed(false),
_cancelled(false),
_ignore_check(false)
#endif
{
if (T::is_enabled()) {
_started = true;
}
}
}
static bool is_enabled() {
}
bool should_commit() {
return _started;
}
void ignoreCheck() {
DEBUG_ONLY(_ignore_check = true);
}
void commit() {
if (!should_commit()) {
cancel();
return;
}
if (_endTime == 0) {
}
if (static_cast<T*>(this)->should_write()) {
static_cast<T*>(this)->writeEvent();
}
set_commited();
}
_startTime = time;
}
}
return T::eventId;
}
bool is_instant() const {
return T::isInstant;
}
bool is_requestable() const {
return T::isRequestable;
}
bool has_thread() const {
return T::hasThread;
}
bool has_stacktrace() const {
return T::hasStackTrace;
}
void cancel() {
DEBUG_ONLY(_cancelled = true);
}
void set_commited() {
DEBUG_ONLY(_committed = true);
}
~TraceEvent() {
if (_started) {
}
}
};
#endif /* INCLUDE_TRACE */
#endif /* SHARE_VM_TRACE_TRACEEVENT_HPP */