1 /*
2 * Copyright (c) 2012, 2018, 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 #include "precompiled.hpp"
26 #include "jfr/dcmd/jfrDcmds.hpp"
27 #include "jfr/recorder/service/jfrMemorySizer.hpp"
28 #include "jfr/recorder/service/jfrOptionSet.hpp"
29 #include "jfr/utilities/jfrAllocation.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "runtime/java.hpp"
33 #include "runtime/thread.inline.hpp"
34 #include "services/diagnosticArgument.hpp"
35 #include "services/diagnosticFramework.hpp"
36 #include "utilities/growableArray.hpp"
37 #include "utilities/ostream.hpp"
38
39 struct ObsoleteOption {
40 const char* name;
41 const char* message;
42 };
43
44 static const ObsoleteOption OBSOLETE_OPTIONS[] = {
45 {"checkpointbuffersize", ""},
46 {"maxsize", "Use -XX:StartFlightRecording=maxsize=... instead."},
47 {"maxage", "Use -XX:StartFlightRecording=maxage=... instead."},
48 {"settings", "Use -XX:StartFlightRecording=settings=... instead."},
49 {"defaultrecording", "Use -XX:StartFlightRecording=disk=false to create an in-memory recording."},
87
88 jlong JfrOptionSet::num_global_buffers() {
89 return _num_global_buffers;
90 }
91
92 void JfrOptionSet::set_num_global_buffers(jlong value) {
93 _num_global_buffers = value;
94 }
95
96 jint JfrOptionSet::old_object_queue_size() {
97 return (jint)_old_object_queue_size;
98 }
99
100 void JfrOptionSet::set_old_object_queue_size(jlong value) {
101 _old_object_queue_size = value;
102 }
103
104 u4 JfrOptionSet::stackdepth() {
105 return _stack_depth;
106 }
107
108 static const u4 STACK_DEPTH_DEFAULT = 64;
109 static const u4 MIN_STACK_DEPTH = 1;
110 static const u4 MAX_STACK_DEPTH = 2048;
111
112 void JfrOptionSet::set_stackdepth(u4 depth) {
113 if (depth < MIN_STACK_DEPTH) {
114 _stack_depth = MIN_STACK_DEPTH;
115 } else if (depth > MAX_STACK_DEPTH) {
116 _stack_depth = MAX_STACK_DEPTH;
117 } else {
118 _stack_depth = depth;
119 }
120 }
121
122 bool JfrOptionSet::sample_threads() {
123 return _sample_threads == JNI_TRUE;
124 }
125
126 void JfrOptionSet::set_sample_threads(jboolean sample) {
127 _sample_threads = sample;
128 }
129
130 bool JfrOptionSet::can_retransform() {
|
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 #include "precompiled.hpp"
26 #include "jfr/dcmd/jfrDcmds.hpp"
27 #include "jfr/recorder/service/jfrMemorySizer.hpp"
28 #include "jfr/recorder/service/jfrOptionSet.hpp"
29 #include "jfr/utilities/jfrAllocation.hpp"
30 #include "jfr/utilities/jfrTypes.hpp"
31 #include "memory/allocation.inline.hpp"
32 #include "memory/resourceArea.hpp"
33 #include "runtime/java.hpp"
34 #include "runtime/thread.inline.hpp"
35 #include "services/diagnosticArgument.hpp"
36 #include "services/diagnosticFramework.hpp"
37 #include "utilities/growableArray.hpp"
38 #include "utilities/ostream.hpp"
39
40 struct ObsoleteOption {
41 const char* name;
42 const char* message;
43 };
44
45 static const ObsoleteOption OBSOLETE_OPTIONS[] = {
46 {"checkpointbuffersize", ""},
47 {"maxsize", "Use -XX:StartFlightRecording=maxsize=... instead."},
48 {"maxage", "Use -XX:StartFlightRecording=maxage=... instead."},
49 {"settings", "Use -XX:StartFlightRecording=settings=... instead."},
50 {"defaultrecording", "Use -XX:StartFlightRecording=disk=false to create an in-memory recording."},
88
89 jlong JfrOptionSet::num_global_buffers() {
90 return _num_global_buffers;
91 }
92
93 void JfrOptionSet::set_num_global_buffers(jlong value) {
94 _num_global_buffers = value;
95 }
96
97 jint JfrOptionSet::old_object_queue_size() {
98 return (jint)_old_object_queue_size;
99 }
100
101 void JfrOptionSet::set_old_object_queue_size(jlong value) {
102 _old_object_queue_size = value;
103 }
104
105 u4 JfrOptionSet::stackdepth() {
106 return _stack_depth;
107 }
108
109 void JfrOptionSet::set_stackdepth(u4 depth) {
110 if (depth < MIN_STACK_DEPTH) {
111 _stack_depth = MIN_STACK_DEPTH;
112 } else if (depth > MAX_STACK_DEPTH) {
113 _stack_depth = MAX_STACK_DEPTH;
114 } else {
115 _stack_depth = depth;
116 }
117 }
118
119 bool JfrOptionSet::sample_threads() {
120 return _sample_threads == JNI_TRUE;
121 }
122
123 void JfrOptionSet::set_sample_threads(jboolean sample) {
124 _sample_threads = sample;
125 }
126
127 bool JfrOptionSet::can_retransform() {
|