Fri, 12 Jun 2020 02:59:56 +0100
8233197: Invert JvmtiExport::post_vm_initialized() and Jfr:on_vm_start() start-up order for correct option parsing
8246703: [TESTBUG] Add test for JDK-8233197
Reviewed-by: aph, adinn, neugens
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 */
25 #ifndef SHARE_VM_JFR_RECORDER_SERVICE_JFROPTIONSET_HPP
26 #define SHARE_VM_JFR_RECORDER_SERVICE_JFROPTIONSET_HPP
28 #include "jni.h"
29 #include "memory/allocation.hpp"
30 #include "utilities/exceptions.hpp"
32 template <typename>
33 class GrowableArray;
35 //
36 // Command-line options and defaults
37 //
38 class JfrOptionSet : public AllStatic {
39 friend class JfrRecorder;
40 private:
41 static jlong _max_chunk_size;
42 static jlong _global_buffer_size;
43 static jlong _thread_buffer_size;
44 static jlong _memory_size;
45 static jlong _num_global_buffers;
46 static jlong _old_object_queue_size;
47 static u4 _stack_depth;
48 static jboolean _sample_threads;
49 static jboolean _retransform;
50 static jboolean _sample_protection;
52 static bool initialize(Thread* thread);
53 static bool configure(TRAPS);
54 static bool adjust_memory_options();
56 public:
57 static jlong max_chunk_size();
58 static void set_max_chunk_size(jlong value);
59 static jlong global_buffer_size();
60 static void set_global_buffer_size(jlong value);
61 static jlong thread_buffer_size();
62 static void set_thread_buffer_size(jlong value);
63 static jlong memory_size();
64 static void set_memory_size(jlong value);
65 static jlong num_global_buffers();
66 static void set_num_global_buffers(jlong value);
67 static jint old_object_queue_size();
68 static void set_old_object_queue_size(jlong value);
69 static u4 stackdepth();
70 static void set_stackdepth(u4 depth);
71 static bool sample_threads();
72 static void set_sample_threads(jboolean sample);
73 static bool can_retransform();
74 static void set_retransform(jboolean value);
75 static bool compressed_integers();
76 static bool allow_retransforms();
77 static bool allow_event_retransforms();
78 static bool sample_protection();
79 DEBUG_ONLY(static void set_sample_protection(jboolean protection);)
81 static bool parse_flight_recorder_option(const JavaVMOption** option, char* delimiter);
82 static bool parse_start_flight_recording_option(const JavaVMOption** option, char* delimiter);
83 static const GrowableArray<const char*>* start_flight_recording_options();
84 static void release_start_flight_recording_options();
85 };
87 #endif // SHARE_VM_JFR_RECORDER_SERVICE_JFROPTIONSET_HPP