annotate src/share/vm/trace/traceBackend.hpp @ 4609:f438a35cc903

8012210: Make TracingTime available when INCLUDE_TRACE = 0 Reviewed-by: dholmes, sla
author rbackman
date Mon, 15 Apr 2013 11:38:46 +0200
parents bb74dc5ddf07
children 04f81958a8e2
rev   line source
sla@4403 1 /*
rbackman@4609 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
sla@4403 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sla@4403 4 *
sla@4403 5 * This code is free software; you can redistribute it and/or modify it
sla@4403 6 * under the terms of the GNU General Public License version 2 only, as
sla@4403 7 * published by the Free Software Foundation.
sla@4403 8 *
sla@4403 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sla@4403 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sla@4403 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sla@4403 12 * version 2 for more details (a copy is included in the LICENSE file that
sla@4403 13 * accompanied this code).
sla@4403 14 *
sla@4403 15 * You should have received a copy of the GNU General Public License version
sla@4403 16 * 2 along with this work; if not, write to the Free Software Foundation,
sla@4403 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sla@4403 18 *
sla@4403 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sla@4403 20 * or visit www.oracle.com if you need additional information or have any
sla@4403 21 * questions.
sla@4403 22 *
sla@4403 23 */
sla@4403 24 #ifndef SHARE_VM_TRACE_TRACEBACKEND_HPP
sla@4403 25 #define SHARE_VM_TRACE_TRACEBACKEND_HPP
sla@4403 26
sla@4403 27 #if INCLUDE_TRACE
sla@4403 28
sla@4403 29 #include "trace/traceTime.hpp"
sla@4403 30 #include "tracefiles/traceEventIds.hpp"
sla@4403 31 #include "runtime/globals.hpp"
sla@4403 32 #include "runtime/os.hpp"
sla@4403 33
sla@4403 34 class TraceBackend {
rbackman@4609 35 public:
sla@4403 36 static bool enabled(TraceEventId id) {
sla@4403 37 return EnableTracing;
sla@4403 38 }
sla@4403 39
sla@4403 40 static TracingTime time() {
sla@4403 41 return os::elapsed_counter();
sla@4403 42 }
sla@4403 43
sla@4403 44 static TracingTime time_adjustment(jlong time) {
sla@4403 45 return time;
sla@4403 46 }
sla@4403 47 };
sla@4403 48
sla@4403 49 typedef TraceBackend Tracing;
sla@4403 50
rbackman@4609 51 #else /* INCLUDE_TRACE */
rbackman@4609 52
rbackman@4609 53 #include "trace/noTraceBackend.hpp"
rbackman@4609 54
sla@4403 55 #endif /* INCLUDE_TRACE */
sla@4403 56 #endif /* SHARE_VM_TRACE_TRACEBACKEND_HPP */