src/share/vm/runtime/timer.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8148630 Cdiff src/share/vm/runtime/timer.cpp

src/share/vm/runtime/timer.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 112,158 **** assert(is_updated(), "must not be clear"); return os::elapsed_counter() - _counter; } TraceTime::TraceTime(const char* title, ! bool doit) { _active = doit; _verbose = true; if (_active) { _accum = NULL; - tty->print("[%s", title); - tty->flush(); _t.start(); } } TraceTime::TraceTime(const char* title, elapsedTimer* accumulator, bool doit, ! bool verbose) { _active = doit; _verbose = verbose; if (_active) { - if (_verbose) { - tty->print("[%s", title); - tty->flush(); - } _accum = accumulator; _t.start(); } } TraceTime::~TraceTime() { if (_active) { _t.stop(); if (_accum!=NULL) _accum->add(_t); if (_verbose) { ! tty->print_cr(", %3.7f secs]", _t.seconds()); tty->flush(); } } } TraceCPUTime::TraceCPUTime(bool doit, bool print_cr, outputStream *logfile) : --- 112,166 ---- assert(is_updated(), "must not be clear"); return os::elapsed_counter() - _counter; } TraceTime::TraceTime(const char* title, ! bool doit, ! LogTagType tag) { _active = doit; _verbose = true; + _tag = tag; + _title = title; if (_active) { _accum = NULL; _t.start(); } } TraceTime::TraceTime(const char* title, elapsedTimer* accumulator, bool doit, ! bool verbose, ! LogTagType tag) { _active = doit; _verbose = verbose; + _tag = tag; + _title = title; + if (_active) { _accum = accumulator; _t.start(); } } TraceTime::~TraceTime() { if (_active) { _t.stop(); if (_accum!=NULL) _accum->add(_t); if (_verbose) { ! switch (_tag) { ! case LogTag::_startuptime : ! log_info(startuptime)("%s, %3.7f secs", _title, _t.seconds()); ! break; ! case LogTag::__NO_TAG : ! default : ! tty->print_cr("[%s, %3.7f secs]", _title, _t.seconds()); tty->flush(); } } + } } TraceCPUTime::TraceCPUTime(bool doit, bool print_cr, outputStream *logfile) :
src/share/vm/runtime/timer.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File