Skip to content

Commit d0ee05f

Browse files
authored
Merge pull request #15823 from yathamravali/addStandaloneOptionForPerfTool
Add standalone JIT option -XX:[+|-]PerfTool
2 parents 2712974 + 4e1f9dc commit d0ee05f

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

runtime/compiler/control/DLLMain.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ IDATA J9VMDllMain(J9JavaVM* vm, IDATA stage, void * reserved)
7979
IDATA argIndexRIEnabled = 0;
8080
IDATA argIndexRIDisabled = 0;
8181

82+
IDATA argIndexPerfEnabled = 0;
83+
IDATA argIndexPerfDisabled = 0;
84+
8285
static bool isJIT = false;
8386
static bool isAOT = false;
8487

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

141+
argIndexPerfEnabled = FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:+PerfTool", 0);
142+
argIndexPerfDisabled = FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:-PerfTool", 0);
143+
144+
// Determine if user disabled PerfTool
145+
if (argIndexPerfEnabled >= 0 || argIndexPerfDisabled >= 0)
146+
TR::Options::_perfToolEnabled = (argIndexPerfDisabled > argIndexPerfEnabled) ? TR_no : TR_yes;
147+
138148
TR::Options::_doNotProcessEnvVars = (FIND_AND_CONSUME_ARG(EXACT_MATCH, "-XX:doNotProcessJitEnvVars", 0) >= 0);
139149

140150
isQuickstart = J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_TUNE_QUICKSTART);

runtime/compiler/control/J9Options.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ int32_t J9::Options::_weightOfAOTLoad = 1; // must be between 0 and 256
219219
int32_t J9::Options::_weightOfJSR292 = 12; // must be between 0 and 256
220220

221221
TR_YesNoMaybe J9::Options::_hwProfilerEnabled = TR_maybe;
222+
TR_YesNoMaybe J9::Options::_perfToolEnabled = TR_no;
222223
int32_t J9::Options::_hwprofilerNumOutstandingBuffers = 256; // 1MB / 4KB buffers
223224

224225
// These numbers are cast into floats divided by 10000

runtime/compiler/control/J9Options.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class OMR_EXTENSIBLE Options : public OMR::OptionsConnector
305305
static int32_t _hwprofilerNumOutstandingBuffers;
306306

307307
static TR_YesNoMaybe _hwProfilerEnabled;
308+
static TR_YesNoMaybe _perfToolEnabled;
308309
static uint32_t _hwprofilerHotOptLevelThreshold;
309310
static uint32_t _hwprofilerScorchingOptLevelThreshold;
310311
static uint32_t _hwprofilerWarmOptLevelThreshold;

runtime/compiler/control/rossa.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,10 @@ onLoadInternal(
13181318
return -1;
13191319
}
13201320

1321+
// Enable perfTool
1322+
if (TR::Options::_perfToolEnabled == TR_yes)
1323+
TR::Options::getCmdLineOptions()->setOption(TR_PerfTool);
1324+
13211325
// Now that the options have been processed we can initialize the RuntimeAssumptionTables
13221326
// If we cannot allocate various runtime assumption hash tables, fail the JVM
13231327

0 commit comments

Comments
 (0)