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