hotspot/src/share/vm/runtime/logTimer.hpp
author jwilhelm
Mon, 22 Feb 2016 19:46:37 +0100
changeset 36199 855b44ce93c0
parent 36178 9739f8c767da
child 37043 5aa55674a362
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36178
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     1
/*
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     4
 *
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     8
 *
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    13
 * accompanied this code).
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    14
 *
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    18
 *
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    21
 * questions.
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    22
 *
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    23
 */
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    24
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    25
#ifndef SHARE_VM_RUNTIME_LOG_TIMER_HPP
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    26
#define SHARE_VM_RUNTIME_LOG_TIMER_HPP
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    27
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    28
#include "logging/log.hpp"
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    29
#include "runtime/timer.hpp"
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    30
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    31
// TraceStartupTime is used for tracing the execution time of a block with logging
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    32
// Usage:
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    33
//  { TraceStartupTime t("block time")
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    34
//    some_code();
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    35
//  }
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    36
//
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    37
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    38
class TraceStartupTime : public TraceTime {
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    39
  public:
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    40
    TraceStartupTime(const char* s) : TraceTime(s, log_is_enabled(Info, startuptime), LogTag::_startuptime) {}
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    41
};
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    42
9739f8c767da 8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
diff changeset
    43
#endif // SHARE_VM_RUNTIME_LOG_TIMER_HPP