8203292: Print complete set of flags in the hs_err file

Prints non-default flags to hs_err file

Reviewed-by: gziemski, dholmes
This commit is contained in:
Volker Simonis 2018-05-21 11:09:58 -05:00
parent cffef5d38c
commit 48fb34d596
3 changed files with 15 additions and 3 deletions

View File

@ -1474,7 +1474,7 @@ void JVMFlag::verify() {
#endif // PRODUCT #endif // PRODUCT
void JVMFlag::printFlags(outputStream* out, bool withComments, bool printRanges) { void JVMFlag::printFlags(outputStream* out, bool withComments, bool printRanges, bool skipDefaults) {
// Print the flags sorted by name // Print the flags sorted by name
// note: this method is called before the thread structure is in place // note: this method is called before the thread structure is in place
// which means resource allocation cannot be used. // which means resource allocation cannot be used.
@ -1497,7 +1497,7 @@ void JVMFlag::printFlags(outputStream* out, bool withComments, bool printRanges)
} }
for (size_t i = 0; i < length; i++) { for (size_t i = 0; i < length; i++) {
if (array[i]->is_unlocked()) { if (array[i]->is_unlocked() && !(skipDefaults && array[i]->is_default())) {
array[i]->print_on(out, withComments, printRanges); array[i]->print_on(out, withComments, printRanges);
} }
} }

View File

@ -275,7 +275,7 @@ public:
static void printSetFlags(outputStream* out); static void printSetFlags(outputStream* out);
// printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
static void printFlags(outputStream* out, bool withComments, bool printRanges = false); static void printFlags(outputStream* out, bool withComments, bool printRanges = false, bool skipDefaults = false);
static void verify() PRODUCT_RETURN; static void verify() PRODUCT_RETURN;
}; };

View File

@ -42,6 +42,7 @@
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
#include "runtime/vm_operations.hpp" #include "runtime/vm_operations.hpp"
#include "runtime/vm_version.hpp" #include "runtime/vm_version.hpp"
#include "runtime/flags/jvmFlag.hpp"
#include "services/memTracker.hpp" #include "services/memTracker.hpp"
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
#include "utilities/decoder.hpp" #include "utilities/decoder.hpp"
@ -911,6 +912,17 @@ void VMError::report(outputStream* st, bool _verbose) {
st->cr(); st->cr();
} }
STEP("printing flags")
if (_verbose) {
JVMFlag::printFlags(
st,
true, // with comments
false, // no ranges
true); // skip defaults
st->cr();
}
STEP("printing warning if internal testing API used") STEP("printing warning if internal testing API used")
if (WhiteBox::used()) { if (WhiteBox::used()) {