author | chegar |
Thu, 17 Oct 2019 20:53:35 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58678 | 9cf78a70fa4f |
parent 53244 | 9807daeb47c4 |
child 58679 | 9c3209ff7550 |
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 |
|
58678 | 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 { |
|
37 |
friend class JfrRecorder; |
|
38 |
friend class JfrRecorderService; |
|
58678 | 39 |
friend class JfrThreadSampleClosure; |
40 |
friend class ObjectSampleCheckpoint; |
|
50113 | 41 |
friend class ObjectSampler; |
58678 | 42 |
friend class StackTraceBlobInstaller; |
43 |
friend class WriteStackTraceRepository; |
|
50113 | 44 |
|
45 |
private: |
|
46 |
static const u4 TABLE_SIZE = 2053; |
|
58678 | 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(); |
|
58678 | 56 |
|
57 |
size_t write_impl(JfrChunkWriter& cw, bool clear); |
|
58 |
static void write_metadata(JfrCheckpointWriter& cpw); |
|
50113 | 59 |
traceid write(JfrCheckpointWriter& cpw, traceid id, unsigned int hash); |
60 |
size_t write(JfrChunkWriter& cw, bool clear); |
|
61 |
size_t clear(); |
|
58678 | 62 |
|
63 |
traceid add_trace(const JfrStackTrace& stacktrace); |
|
64 |
static traceid add(const JfrStackTrace& stacktrace); |
|
65 |
traceid record_for(JavaThread* thread, int skip, JfrStackFrame* frames, u4 max_frames); |
|
66 |
const JfrStackTrace* lookup(unsigned int hash, traceid id) const; |
|
67 |
||
68 |
public: |
|
69 |
static traceid record(Thread* thread, int skip = 0); |
|
70 |
static void record_and_cache(JavaThread* thread, int skip = 0); |
|
50113 | 71 |
}; |
72 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52903
diff
changeset
|
73 |
#endif // SHARE_JFR_RECORDER_STACKTRACE_JFRSTACKTRACEREPOSITORY_HPP |