1.1 --- a/src/share/vm/runtime/arguments.cpp Thu Aug 01 03:44:03 2019 +0100 1.2 +++ b/src/share/vm/runtime/arguments.cpp Mon Aug 12 18:30:40 2019 +0300 1.3 @@ -44,6 +44,9 @@ 1.4 #include "utilities/macros.hpp" 1.5 #include "utilities/stringUtils.hpp" 1.6 #include "utilities/taskqueue.hpp" 1.7 +#if INCLUDE_JFR 1.8 +#include "jfr/jfr.hpp" 1.9 +#endif 1.10 #ifdef TARGET_OS_FAMILY_linux 1.11 # include "os_linux.inline.hpp" 1.12 #endif 1.13 @@ -155,6 +158,20 @@ 1.14 } 1.15 } 1.16 1.17 +#if INCLUDE_JFR 1.18 +// return true on failure 1.19 +static bool match_jfr_option(const JavaVMOption** option) { 1.20 + assert((*option)->optionString != NULL, "invariant"); 1.21 + char* tail = NULL; 1.22 + if (match_option(*option, "-XX:StartFlightRecording", (const char**)&tail)) { 1.23 + return Jfr::on_start_flight_recording_option(option, tail); 1.24 + } else if (match_option(*option, "-XX:FlightRecorderOptions", (const char**)&tail)) { 1.25 + return Jfr::on_flight_recorder_option(option, tail); 1.26 + } 1.27 + return false; 1.28 +} 1.29 +#endif 1.30 + 1.31 static void logOption(const char* opt) { 1.32 if (PrintVMOptions) { 1.33 jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt); 1.34 @@ -3399,6 +3416,10 @@ 1.35 "ManagementServer is not supported in this VM.\n"); 1.36 return JNI_ERR; 1.37 #endif // INCLUDE_MANAGEMENT 1.38 +#if INCLUDE_JFR 1.39 + } else if (match_jfr_option(&option)) { 1.40 + return JNI_EINVAL; 1.41 +#endif 1.42 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx 1.43 // Skip -XX:Flags= since that case has already been handled 1.44 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {