26
26
#define SHARE_JFR_DCMD_JFRDCMDS_HPP
27
27
28
28
#include " services/diagnosticCommand.hpp"
29
+ class JfrJavaArguments ;
29
30
30
- class JfrDumpFlightRecordingDCmd : public DCmdWithParser {
31
+ class JfrDCmd : public DCmd {
32
+ private:
33
+ const char * _args;
34
+ char _delimiter;
35
+ public:
36
+ JfrDCmd (outputStream* output, bool heap) : DCmd(output,heap), _args(NULL ), _delimiter(' \0 ' ) {}
37
+
38
+ virtual void execute (DCmdSource source, TRAPS);
39
+ virtual void print_help (const char * name) const ;
40
+ virtual GrowableArray<const char *>* argument_name_array () const ;
41
+ virtual GrowableArray<DCmdArgumentInfo*>* argument_info_array () const ;
42
+ virtual void parse (CmdLine* line, char delim, TRAPS);
31
43
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;
44
+ virtual const char * javaClass () const = 0;
45
+ void invoke (JfrJavaArguments& method, TRAPS) const ;
46
+ };
39
47
48
+ class JfrStartFlightRecordingDCmd : public JfrDCmd {
40
49
public:
41
- JfrDumpFlightRecordingDCmd (outputStream* output, bool heap);
50
+ JfrStartFlightRecordingDCmd (outputStream* output, bool heap) : JfrDCmd(output, heap) {}
51
+
42
52
static const char * name () {
43
- return " JFR.dump " ;
53
+ return " JFR.start " ;
44
54
}
45
55
static const char * description () {
46
- return " Copies contents of a JFR recording to file. Either the name or the recording id must be specified. " ;
56
+ return " Starts a new JFR recording" ;
47
57
}
48
58
static const char * impact () {
49
- return " Low " ;
59
+ return " Medium: Depending on the settings for a recording, the impact can range from low to high. " ;
50
60
}
51
61
static const JavaPermission permission () {
52
62
JavaPermission p = {" java.lang.management.ManagementPermission" , " monitor" , NULL };
53
63
return p;
54
64
}
55
- static int num_arguments ();
56
- virtual void execute (DCmdSource source, TRAPS);
65
+ virtual const char * javaClass () const {
66
+ return " jdk/jfr/internal/dcmd/DCmdStart" ;
67
+ }
57
68
};
58
69
59
- class JfrCheckFlightRecordingDCmd : public DCmdWithParser {
60
- protected:
61
- DCmdArgument<char *> _name;
62
- DCmdArgument<bool > _verbose;
63
-
70
+ class JfrDumpFlightRecordingDCmd : public JfrDCmd {
64
71
public:
65
- JfrCheckFlightRecordingDCmd (outputStream* output, bool heap);
72
+ JfrDumpFlightRecordingDCmd (outputStream* output, bool heap) : JfrDCmd(output, heap) {}
73
+
66
74
static const char * name () {
67
- return " JFR.check " ;
75
+ return " JFR.dump " ;
68
76
}
69
77
static const char * description () {
70
- return " Checks running JFR recording(s) " ;
78
+ return " Copies contents of a JFR recording to file. Either the name or the recording id must be specified. " ;
71
79
}
72
80
static const char * impact () {
73
81
return " Low" ;
@@ -76,50 +84,37 @@ class JfrCheckFlightRecordingDCmd : public DCmdWithParser {
76
84
JavaPermission p = {" java.lang.management.ManagementPermission" , " monitor" , NULL };
77
85
return p;
78
86
}
79
- static int num_arguments ();
80
- virtual void execute (DCmdSource source, TRAPS);
87
+ virtual const char * javaClass () const {
88
+ return " jdk/jfr/internal/dcmd/DCmdDump" ;
89
+ }
81
90
};
82
91
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
-
92
+ class JfrCheckFlightRecordingDCmd : public JfrDCmd {
97
93
public:
98
- JfrStartFlightRecordingDCmd (outputStream* output, bool heap);
94
+ JfrCheckFlightRecordingDCmd (outputStream* output, bool heap) : JfrDCmd(output, heap) {}
95
+
99
96
static const char * name () {
100
- return " JFR.start " ;
97
+ return " JFR.check " ;
101
98
}
102
99
static const char * description () {
103
- return " Starts a new JFR recording" ;
100
+ return " Checks running JFR recording(s) " ;
104
101
}
105
102
static const char * impact () {
106
- return " Medium: Depending on the settings for a recording, the impact can range from low to high. " ;
103
+ return " Low " ;
107
104
}
108
105
static const JavaPermission permission () {
109
106
JavaPermission p = {" java.lang.management.ManagementPermission" , " monitor" , NULL };
110
107
return p;
111
108
}
112
- static int num_arguments ();
113
- virtual void execute (DCmdSource source, TRAPS);
109
+ virtual const char * javaClass () const {
110
+ return " jdk/jfr/internal/dcmd/DCmdCheck" ;
111
+ }
114
112
};
115
113
116
- class JfrStopFlightRecordingDCmd : public DCmdWithParser {
117
- protected:
118
- DCmdArgument<char *> _name;
119
- DCmdArgument<char *> _filename;
120
-
114
+ class JfrStopFlightRecordingDCmd : public JfrDCmd {
121
115
public:
122
- JfrStopFlightRecordingDCmd (outputStream* output, bool heap);
116
+ JfrStopFlightRecordingDCmd (outputStream* output, bool heap) : JfrDCmd(output, heap) {}
117
+
123
118
static const char * name () {
124
119
return " JFR.stop" ;
125
120
}
@@ -133,12 +128,11 @@ class JfrStopFlightRecordingDCmd : public DCmdWithParser {
133
128
JavaPermission p = {" java.lang.management.ManagementPermission" , " monitor" , NULL };
134
129
return p;
135
130
}
136
- static int num_arguments ();
137
- virtual void execute (DCmdSource source, TRAPS);
131
+ virtual const char * javaClass () const {
132
+ return " jdk/jfr/internal/dcmd/DCmdStop" ;
133
+ }
138
134
};
139
135
140
- class JfrRuntimeOptions ;
141
-
142
136
class JfrConfigureFlightRecorderDCmd : public DCmdWithParser {
143
137
friend class JfrOptionSet ;
144
138
protected:
@@ -173,8 +167,10 @@ class JfrConfigureFlightRecorderDCmd : public DCmdWithParser {
173
167
}
174
168
static int num_arguments ();
175
169
virtual void execute (DCmdSource source, TRAPS);
170
+ virtual void print_help (const char * name) const ;
176
171
};
177
172
173
+
178
174
bool register_jfr_dcmds ();
179
175
180
176
#endif // SHARE_JFR_DCMD_JFRDCMDS_HPP
0 commit comments