author | stuefe |
Fri, 07 Sep 2018 07:52:35 +0200 | |
branch | stuefe-statistical-history |
changeset 57221 | 9653470b7294 |
permissions | -rw-r--r-- |
57221
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
1 |
/* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
3 |
* Copyright (c) 2018, SAP SE. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
4 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
5 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
6 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
7 |
* This code is free software; you can redistribute it and/or modify it |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
8 |
* under the terms of the GNU General Public License version 2 only, as |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
9 |
* published by the Free Software Foundation. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
10 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
15 |
* accompanied this code). |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
16 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
20 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
23 |
* questions. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
24 |
* |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
25 |
*/ |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
26 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
27 |
#ifndef HOTSPOT_SHARE_SERVICES_STATHIST_HPP |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
28 |
#define HOTSPOT_SHARE_SERVICES_STATHIST_HPP |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
29 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
30 |
#include "utilities/globalDefinitions.hpp" |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
31 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
32 |
class outputStream; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
33 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
34 |
namespace StatisticsHistory { |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
35 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
36 |
bool initialize(); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
37 |
void cleanup(); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
38 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
39 |
struct print_info_t { |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
40 |
bool raw; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
41 |
bool cvs; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
42 |
// Omit printing a legend. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
43 |
bool no_legend; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
44 |
// Normally, when we print a report, we sample the current values too and print it atop of the table. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
45 |
// We may want to avoid that, e.g. during error handling. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
46 |
bool avoid_sampling; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
47 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
48 |
size_t scale; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
49 |
}; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
50 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
51 |
// If no print info is given (print_info == NULL), we print with default settings |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
52 |
void print_report(outputStream* st, const print_info_t* print_info = NULL); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
53 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
54 |
// These are counters for the statistics history. Ideally, they would live |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
55 |
// inside their thematical homes, e.g. thread.cpp or classLoaderDataGraph.cpp, |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
56 |
// however since this is unlikely ever to be brought upstream we keep this separate |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
57 |
// to easy maintenance. |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
58 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
59 |
namespace counters { |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
60 |
void inc_classes_loaded(size_t count); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
61 |
void inc_classes_unloaded(size_t count); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
62 |
void inc_threads_created(size_t count); |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
63 |
}; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
64 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
65 |
}; |
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
66 |
|
9653470b7294
Initial implementation of statistical history (JDK-8212618)
stuefe
parents:
diff
changeset
|
67 |
#endif /* HOTSPOT_SHARE_SERVICES_STATHIST_HPP */ |