Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standalone JIT option -XX:[+|-]PerfTool #15823

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions runtime/compiler/control/DLLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ IDATA J9VMDllMain(J9JavaVM* vm, IDATA stage, void * reserved)
IDATA argIndexRIEnabled = 0;
IDATA argIndexRIDisabled = 0;

IDATA argIndexPerfEnabled = 0;
IDATA argIndexPerfDisabled = 0;

static bool isJIT = false;
static bool isAOT = false;

Expand Down Expand Up @@ -135,6 +138,13 @@ IDATA J9VMDllMain(J9JavaVM* vm, IDATA stage, void * reserved)
if (argIndexRIEnabled >= 0 || argIndexRIDisabled >= 0)
TR::Options::_hwProfilerEnabled = (argIndexRIDisabled > argIndexRIEnabled) ? TR_no : TR_yes;

argIndexPerfEnabled = FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:+PerfTool", 0);
argIndexPerfDisabled = FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:-PerfTool", 0);

// Determine if user disabled PerfTool
if (argIndexPerfEnabled >= 0 || argIndexPerfDisabled >= 0)
TR::Options::_perfToolEnabled = (argIndexPerfDisabled > argIndexPerfEnabled) ? TR_no : TR_yes;

TR::Options::_doNotProcessEnvVars = (FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:doNotProcessJitEnvVars", 0) >= 0);

isQuickstart = J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_TUNE_QUICKSTART);
Expand Down
1 change: 1 addition & 0 deletions runtime/compiler/control/J9Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ int32_t J9::Options::_weightOfAOTLoad = 1; // must be between 0 and 256
int32_t J9::Options::_weightOfJSR292 = 12; // must be between 0 and 256

TR_YesNoMaybe J9::Options::_hwProfilerEnabled = TR_maybe;
TR_YesNoMaybe J9::Options::_perfToolEnabled = TR_no;
int32_t J9::Options::_hwprofilerNumOutstandingBuffers = 256; // 1MB / 4KB buffers

// These numbers are cast into floats divided by 10000
Expand Down
1 change: 1 addition & 0 deletions runtime/compiler/control/J9Options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class OMR_EXTENSIBLE Options : public OMR::OptionsConnector
static int32_t _hwprofilerNumOutstandingBuffers;

static TR_YesNoMaybe _hwProfilerEnabled;
static TR_YesNoMaybe _perfToolEnabled;
static uint32_t _hwprofilerHotOptLevelThreshold;
static uint32_t _hwprofilerScorchingOptLevelThreshold;
static uint32_t _hwprofilerWarmOptLevelThreshold;
Expand Down
4 changes: 4 additions & 0 deletions runtime/compiler/control/rossa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,10 @@ onLoadInternal(
return -1;
}

// Enable perfTool
if (TR::Options::_perfToolEnabled == TR_yes)
TR::Options::getCmdLineOptions()->setOption(TR_PerfTool);

// Now that the options have been processed we can initialize the RuntimeAssumptionTables
// If we cannot allocate various runtime assumption hash tables, fail the JVM

Expand Down