src/share/vm/runtime/arguments.cpp

changeset 9858
b985cbb00e68
parent 9711
0f2fe7d37d8c
child 9896
1b8c45b8216a
equal deleted inserted replaced
9727:c7a3e57fdf4a 9858:b985cbb00e68
42 #include "services/memTracker.hpp" 42 #include "services/memTracker.hpp"
43 #include "utilities/defaultStream.hpp" 43 #include "utilities/defaultStream.hpp"
44 #include "utilities/macros.hpp" 44 #include "utilities/macros.hpp"
45 #include "utilities/stringUtils.hpp" 45 #include "utilities/stringUtils.hpp"
46 #include "utilities/taskqueue.hpp" 46 #include "utilities/taskqueue.hpp"
47 #if INCLUDE_JFR
48 #include "jfr/jfr.hpp"
49 #endif
47 #ifdef TARGET_OS_FAMILY_linux 50 #ifdef TARGET_OS_FAMILY_linux
48 # include "os_linux.inline.hpp" 51 # include "os_linux.inline.hpp"
49 #endif 52 #endif
50 #ifdef TARGET_OS_FAMILY_solaris 53 #ifdef TARGET_OS_FAMILY_solaris
51 # include "os_solaris.inline.hpp" 54 # include "os_solaris.inline.hpp"
152 return true; 155 return true;
153 } else { 156 } else {
154 return false; 157 return false;
155 } 158 }
156 } 159 }
160
161 #if INCLUDE_JFR
162 // return true on failure
163 static bool match_jfr_option(const JavaVMOption** option) {
164 assert((*option)->optionString != NULL, "invariant");
165 char* tail = NULL;
166 if (match_option(*option, "-XX:StartFlightRecording", (const char**)&tail)) {
167 return Jfr::on_start_flight_recording_option(option, tail);
168 } else if (match_option(*option, "-XX:FlightRecorderOptions", (const char**)&tail)) {
169 return Jfr::on_flight_recorder_option(option, tail);
170 }
171 return false;
172 }
173 #endif
157 174
158 static void logOption(const char* opt) { 175 static void logOption(const char* opt) {
159 if (PrintVMOptions) { 176 if (PrintVMOptions) {
160 jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt); 177 jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
161 } 178 }
3397 } else if (match_option(option, "-XX:+ManagementServer", &tail)) { 3414 } else if (match_option(option, "-XX:+ManagementServer", &tail)) {
3398 jio_fprintf(defaultStream::error_stream(), 3415 jio_fprintf(defaultStream::error_stream(),
3399 "ManagementServer is not supported in this VM.\n"); 3416 "ManagementServer is not supported in this VM.\n");
3400 return JNI_ERR; 3417 return JNI_ERR;
3401 #endif // INCLUDE_MANAGEMENT 3418 #endif // INCLUDE_MANAGEMENT
3419 #if INCLUDE_JFR
3420 } else if (match_jfr_option(&option)) {
3421 return JNI_EINVAL;
3422 #endif
3402 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx 3423 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3403 // Skip -XX:Flags= since that case has already been handled 3424 // Skip -XX:Flags= since that case has already been handled
3404 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { 3425 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
3405 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { 3426 if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3406 return JNI_EINVAL; 3427 return JNI_EINVAL;

mercurial