Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp
41149 views
1
/*
2
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
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
25
#ifndef SHARE_JFR_DCMD_JFRDCMDS_HPP
26
#define SHARE_JFR_DCMD_JFRDCMDS_HPP
27
28
#include "services/diagnosticCommand.hpp"
29
30
class JfrDumpFlightRecordingDCmd : public DCmdWithParser {
31
protected:
32
DCmdArgument<char*> _name;
33
DCmdArgument<char*> _filename;
34
DCmdArgument<NanoTimeArgument> _maxage;
35
DCmdArgument<MemorySizeArgument> _maxsize;
36
DCmdArgument<char*> _begin;
37
DCmdArgument<char*> _end;
38
DCmdArgument<bool> _path_to_gc_roots;
39
40
public:
41
JfrDumpFlightRecordingDCmd(outputStream* output, bool heap);
42
static const char* name() {
43
return "JFR.dump";
44
}
45
static const char* description() {
46
return "Copies contents of a JFR recording to file. Either the name or the recording id must be specified.";
47
}
48
static const char* impact() {
49
return "Low";
50
}
51
static const JavaPermission permission() {
52
JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};
53
return p;
54
}
55
static int num_arguments();
56
virtual void execute(DCmdSource source, TRAPS);
57
};
58
59
class JfrCheckFlightRecordingDCmd : public DCmdWithParser {
60
protected:
61
DCmdArgument<char*> _name;
62
DCmdArgument<bool> _verbose;
63
64
public:
65
JfrCheckFlightRecordingDCmd(outputStream* output, bool heap);
66
static const char* name() {
67
return "JFR.check";
68
}
69
static const char* description() {
70
return "Checks running JFR recording(s)";
71
}
72
static const char* impact() {
73
return "Low";
74
}
75
static const JavaPermission permission() {
76
JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};
77
return p;
78
}
79
static int num_arguments();
80
virtual void execute(DCmdSource source, TRAPS);
81
};
82
83
class JfrStartFlightRecordingDCmd : public DCmdWithParser {
84
protected:
85
DCmdArgument<char*> _name;
86
DCmdArgument<StringArrayArgument*> _settings;
87
DCmdArgument<NanoTimeArgument> _delay;
88
DCmdArgument<NanoTimeArgument> _duration;
89
DCmdArgument<bool> _disk;
90
DCmdArgument<char*> _filename;
91
DCmdArgument<NanoTimeArgument> _maxage;
92
DCmdArgument<MemorySizeArgument> _maxsize;
93
DCmdArgument<NanoTimeArgument> _flush_interval;
94
DCmdArgument<bool> _dump_on_exit;
95
DCmdArgument<bool> _path_to_gc_roots;
96
97
public:
98
JfrStartFlightRecordingDCmd(outputStream* output, bool heap);
99
static const char* name() {
100
return "JFR.start";
101
}
102
static const char* description() {
103
return "Starts a new JFR recording";
104
}
105
static const char* impact() {
106
return "Medium: Depending on the settings for a recording, the impact can range from low to high.";
107
}
108
static const JavaPermission permission() {
109
JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};
110
return p;
111
}
112
static int num_arguments();
113
virtual void execute(DCmdSource source, TRAPS);
114
};
115
116
class JfrStopFlightRecordingDCmd : public DCmdWithParser {
117
protected:
118
DCmdArgument<char*> _name;
119
DCmdArgument<char*> _filename;
120
121
public:
122
JfrStopFlightRecordingDCmd(outputStream* output, bool heap);
123
static const char* name() {
124
return "JFR.stop";
125
}
126
static const char* description() {
127
return "Stops a JFR recording";
128
}
129
static const char* impact() {
130
return "Low";
131
}
132
static const JavaPermission permission() {
133
JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};
134
return p;
135
}
136
static int num_arguments();
137
virtual void execute(DCmdSource source, TRAPS);
138
};
139
140
class JfrRuntimeOptions;
141
142
class JfrConfigureFlightRecorderDCmd : public DCmdWithParser {
143
friend class JfrOptionSet;
144
protected:
145
DCmdArgument<char*> _repository_path;
146
DCmdArgument<char*> _dump_path;
147
DCmdArgument<jlong> _stack_depth;
148
DCmdArgument<jlong> _global_buffer_count;
149
DCmdArgument<MemorySizeArgument> _global_buffer_size;
150
DCmdArgument<MemorySizeArgument> _thread_buffer_size;
151
DCmdArgument<MemorySizeArgument> _memory_size;
152
DCmdArgument<MemorySizeArgument> _max_chunk_size;
153
DCmdArgument<bool> _sample_threads;
154
bool _verbose;
155
156
public:
157
JfrConfigureFlightRecorderDCmd(outputStream* output, bool heap);
158
void set_verbose(bool verbose) {
159
_verbose = verbose;
160
}
161
static const char* name() {
162
return "JFR.configure";
163
}
164
static const char* description() {
165
return "Configure JFR";
166
}
167
static const char* impact() {
168
return "Low";
169
}
170
static const JavaPermission permission() {
171
JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL};
172
return p;
173
}
174
static int num_arguments();
175
virtual void execute(DCmdSource source, TRAPS);
176
};
177
178
bool register_jfr_dcmds();
179
180
#endif // SHARE_JFR_DCMD_JFRDCMDS_HPP
181
182