author | mgronlun |
Thu, 29 Aug 2019 13:08:13 +0200 | |
branch | JEP-349-branch |
changeset 57935 | 123705b84980 |
parent 57934 | 9c150f2b1fea |
child 57936 | 1b2d0f4c1e38 |
permissions | -rw-r--r-- |
50113 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52903
diff
changeset
|
2 |
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
50113 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52903
diff
changeset
|
25 |
#ifndef SHARE_JFR_RECORDER_STACKTRACE_JFRSTACKTRACEREPOSITORY_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52903
diff
changeset
|
26 |
#define SHARE_JFR_RECORDER_STACKTRACE_JFRSTACKTRACEREPOSITORY_HPP |
50113 | 27 |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
28 |
#include "jfr/recorder/stacktrace/jfrStackTrace.hpp" |
50113 | 29 |
#include "jfr/utilities/jfrAllocation.hpp" |
30 |
#include "jfr/utilities/jfrTypes.hpp" |
|
31 |
||
32 |
class JavaThread; |
|
33 |
class JfrCheckpointWriter; |
|
34 |
class JfrChunkWriter; |
|
35 |
||
36 |
class JfrStackTraceRepository : public JfrCHeapObj { |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
37 |
friend class FlushStackTraceRepository; |
50113 | 38 |
friend class JfrRecorder; |
39 |
friend class JfrRecorderService; |
|
57902 | 40 |
friend class JfrThreadSampleClosure; |
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
41 |
friend class ObjectSampleCheckpoint; |
50113 | 42 |
friend class ObjectSampler; |
57934 | 43 |
friend class StackTraceResolver; |
50113 | 44 |
|
45 |
private: |
|
46 |
static const u4 TABLE_SIZE = 2053; |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
47 |
JfrStackTrace* _table[TABLE_SIZE]; |
50113 | 48 |
traceid _next_id; |
49 |
u4 _entries; |
|
50 |
||
51 |
JfrStackTraceRepository(); |
|
52 |
static JfrStackTraceRepository& instance(); |
|
53 |
static JfrStackTraceRepository* create(); |
|
54 |
bool initialize(); |
|
55 |
static void destroy(); |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
56 |
|
57872 | 57 |
bool is_modified() const; |
58 |
||
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
59 |
size_t write_impl(JfrChunkWriter& cw, bool clear); |
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
60 |
static void write_metadata(JfrCheckpointWriter& cpw); |
50113 | 61 |
traceid write(JfrCheckpointWriter& cpw, traceid id, unsigned int hash); |
62 |
size_t write(JfrChunkWriter& cw, bool clear); |
|
63 |
size_t clear(); |
|
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
64 |
|
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
65 |
traceid add_trace(const JfrStackTrace& stacktrace); |
57902 | 66 |
static traceid add(const JfrStackTrace& stacktrace); |
57870
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
67 |
traceid record_for(JavaThread* thread, int skip, JfrStackFrame* frames, u4 max_frames); |
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
68 |
const JfrStackTrace* lookup(unsigned int hash, traceid id) const; |
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
69 |
|
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
70 |
public: |
00860d9caf4d
New metadata system for oldobjects built on top of simplified tagging model. Caching and serialization improvements. Flushpoint checkpoint with chunkheader contents.
mgronlun
parents:
57360
diff
changeset
|
71 |
static traceid record(Thread* thread, int skip = 0); |
57934 | 72 |
static void record_and_cache(JavaThread* thread, int skip = 0); |
50113 | 73 |
}; |
74 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52903
diff
changeset
|
75 |
#endif // SHARE_JFR_RECORDER_STACKTRACE_JFRSTACKTRACEREPOSITORY_HPP |