comparison src/share/vm/runtime/timer.hpp @ 10405:f2110083203d

8005849: JEP 167: Event-Based JVM Tracing Reviewed-by: acorn, coleenp, sla Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author sla
date Mon, 10 Jun 2013 11:30:51 +0200
parents f95d63e2154a
children c0b0974dd509
comparison
equal deleted inserted replaced
10404:d0add7016434 10405:f2110083203d
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
80 80
81 class TraceTime: public StackObj { 81 class TraceTime: public StackObj {
82 private: 82 private:
83 bool _active; // do timing 83 bool _active; // do timing
84 bool _verbose; // report every timing 84 bool _verbose; // report every timing
85 bool _print_cr; // add a CR to the end of the timer report
86 elapsedTimer _t; // timer 85 elapsedTimer _t; // timer
87 elapsedTimer* _accum; // accumulator 86 elapsedTimer* _accum; // accumulator
88 outputStream* _logfile; // output log file
89 public: 87 public:
90 // Constuctors 88 // Constructors
91 TraceTime(const char* title, 89 TraceTime(const char* title,
92 bool doit = true, 90 bool doit = true);
93 bool print_cr = true,
94 outputStream *logfile = NULL);
95 TraceTime(const char* title, 91 TraceTime(const char* title,
96 elapsedTimer* accumulator, 92 elapsedTimer* accumulator,
97 bool doit = true, 93 bool doit = true,
98 bool verbose = false, 94 bool verbose = false);
99 outputStream *logfile = NULL );
100 ~TraceTime(); 95 ~TraceTime();
101 96
102 // Accessors 97 // Accessors
103 void set_verbose(bool verbose) { _verbose = verbose; } 98 void set_verbose(bool verbose) { _verbose = verbose; }
104 bool verbose() const { return _verbose; } 99 bool verbose() const { return _verbose; }
123 bool print_cr = true, 118 bool print_cr = true,
124 outputStream *logfile = NULL); 119 outputStream *logfile = NULL);
125 ~TraceCPUTime(); 120 ~TraceCPUTime();
126 }; 121 };
127 122
123 class TimeHelper {
124 public:
125 static double counter_to_seconds(jlong counter);
126 };
127
128 #endif // SHARE_VM_RUNTIME_TIMER_HPP 128 #endif // SHARE_VM_RUNTIME_TIMER_HPP