< prev index next >
src/hotspot/share/runtime/arguments.cpp
Print this page
rev 49619 : JEP 328 : Flight Recorder open source preview
@@ -34,10 +34,11 @@
#include "gc/shared/gcConfig.hpp"
#include "logging/log.hpp"
#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"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
@@ -260,10 +261,22 @@
}
}
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);
}
}
@@ -3162,10 +3175,12 @@
} else if (match_option(option, "-XX:+ManagementServer")) {
jio_fprintf(defaultStream::error_stream(),
"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
if ((strncmp(tail, "Flags=", strlen("Flags=")) != 0) &&
(strncmp(tail, "VMOptionsFile=", strlen("VMOptionsFile=")) != 0)) {
< prev index next >