Skip to content

Commit

Permalink
Merge pull request #15849 from yathamravali/addStandaloneOptionForPer…
Browse files Browse the repository at this point in the history
…fTool_0.35

(0.35) Add standalone JIT option -XX:[+|-]PerfTool
  • Loading branch information
dsouzai committed Sep 8, 2022
2 parents 1de4f14 + ea064ba commit 7dd982b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
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 @@ -215,6 +215,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 @@ -301,6 +301,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

0 comments on commit 7dd982b

Please sign in to comment.