--- old/src/hotspot/share/runtime/arguments.cpp 2018-04-09 14:14:48.871048259 +0200 +++ new/src/hotspot/share/runtime/arguments.cpp 2018-04-09 14:14:48.118000794 +0200 @@ -36,6 +36,7 @@ #include "logging/logConfiguration.hpp" #include "logging/logStream.hpp" #include "logging/logTag.hpp" +#include "jfr/recorder/access/jfrOptionSet.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" @@ -262,6 +263,18 @@ return false; } +// return true on failure +static bool match_jfr_option(const JavaVMOption** option) { + assert((*option)->optionString != NULL, "invariant"); + char* tail = NULL; + if (match_option(*option, "-XX:StartFlightRecording", (const char**)&tail)) { + return JfrOptionSet::parse_start_flight_recording(option, tail); + } else if (match_option(*option, "-XX:FlightRecorderOptions", (const char**)&tail)) { + return JfrOptionSet::parse_flight_recorder_options(option, tail); + } + return false; +} + static void logOption(const char* opt) { if (PrintVMOptions) { jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt); @@ -3164,6 +3177,8 @@ "ManagementServer is not supported in this VM.\n"); return JNI_ERR; #endif // INCLUDE_MANAGEMENT + } else if (match_jfr_option(&option)) { + return JNI_EINVAL; } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx // Skip -XX:Flags= and -XX:VMOptionsFile= since those cases have // already been handled