Skip to content

Print compilation thread shutdown message - #13784

Merged
mpirvu merged 1 commit into
eclipse-openj9:masterfrom
singh264:compilation_thread_shutdown_message
Nov 1, 2021
Merged

mpirvu merged 1 commit into
eclipse-openj9:masterfrom
singh264:compilation_thread_shutdown_message

Conversation

@singh264

Copy link
Copy Markdown
Contributor

Closes: #421
Signed-off-by: Amarpreet Singh amarpreet1997@gmail.com

@singh264
singh264 marked this pull request as ready for review October 26, 2021 15:05
@singh264 singh264 changed the title [WIP] Compilation thread shutdown message Compilation thread shutdown message Oct 26, 2021
@singh264

Copy link
Copy Markdown
Contributor Author

@ymanton

@singh264
singh264 force-pushed the compilation_thread_shutdown_message branch 2 times, most recently from d6f4a7d to cd049eb Compare October 26, 2021 15:16
@singh264 singh264 changed the title Compilation thread shutdown message Add compilation thread shutdown message Oct 26, 2021
@singh264
singh264 force-pushed the compilation_thread_shutdown_message branch from cd049eb to 5281173 Compare October 26, 2021 15:28

@ymanton ymanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't print anything to the vlog by default, it's gated by TR_VerbosePerformance, which is not part of the verbose sub-options that are in effect by default.

It needs to print something to the vlog when one does java -Xjit:verbose -version, so you need to figure out what, if anything, to gate it by. For reference, the default verbose sub-options is defined here in the entry for "verbose":

https://github.com/eclipse/omr/blob/ad71b3d2fd1b3d8905caa6baae178d80db092cf0/compiler/env/FEBase.cpp#L108-L124

TR::OptionTable OMR::Options::_feOptions[] =
   {
   {"code=",              "C<nnn>\tsize of a single code cache, in KB",
    TR::Options::set32BitNumericInJitConfig, offsetof(OMR::FrontEnd::JitConfig, options.codeCacheKB), 0, " %d (KB)"},
   {"exclude=",   "D{regexp}\tdo not compile methods matching regexp", TR::Options::limitOption, 1, 0, "P%s"},
   {"limit=",     "D{regexp}\tonly compile methods matching regexp", TR::Options::limitOption, 0, 0, "P%s"},
   {"limitfile=", "D<filename>\tfilter methods as defined in filename.  "
                  "Use limitfile=(filename,firstLine,lastLine) to limit lines considered from firstLine to lastLine", TR::Options::limitfileOption, 0, 0, "P%s"},
   {"verbose",    "L\twrite compiled method names to vlog file or stdout in limitfile format",
    TR::Options::setVerboseBits, offsetof(TR::JitConfig, options.verboseFlags), (1<<TR_VerboseCompileStart)|(1<<TR_VerboseCompileEnd), "F=1"},
   {"verbose=",   "L{regex}\tlist of verbose output to write to vlog or stdout",
    TR::Options::setVerboseBits, offsetof(TR::JitConfig, options.verboseFlags), 0, "F"},
   {"version",     "M\tprint out JIT version", TR::Options::versionOption, 0, 0, "F"},
   {"vlog=",      "L<filename>\twrite verbose output to filename",
    TR::Options::setStringInJitConfig, offsetof(TR::JitConfig, options.vLogFileName), 0, "P%s"},
   {0}
   };

Your options are to introduce a new verbose sub-option and add it to the default set, use one of the existing ones (e.g. TR_VerboseCompileEnd), or find some other means to get the desired effect.

@singh264
singh264 force-pushed the compilation_thread_shutdown_message branch from 5281173 to feb9ab4 Compare October 26, 2021 21:05
@singh264

Copy link
Copy Markdown
Contributor Author

I think I am able to print the verbose log message by default by moving the print statement outside of the conditional that checks to see if the TR_VerbosePerformance verbose option is supplied.

@singh264 singh264 changed the title Add compilation thread shutdown message Print compilation thread shutdown message Oct 27, 2021
@singh264
singh264 requested a review from ymanton October 27, 2021 13:41

@ymanton ymanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will take a lock and do a lot of pointless work even if verbose output is not requested. We can do better; try using the TR::Options::isAnyVerboseOptionSet() query to gate your message.

Also, please describe what you're doing, provide an example of the output, and ask for any feedback in #421.

@singh264
singh264 force-pushed the compilation_thread_shutdown_message branch from feb9ab4 to 29b50d2 Compare October 27, 2021 20:27
@singh264

Copy link
Copy Markdown
Contributor Author

I think the verbose log message should now be displayed when any verbose option is supplied 29b50d2.

@ymanton ymanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's find a different tag for this message; it isn't related to performance so TR_Vlog_PERF doesn't make sense.

Closes: eclipse-openj9#421
Signed-off-by: Amarpreet Singh amarpreet1997@gmail.com
@singh264
singh264 force-pushed the compilation_thread_shutdown_message branch from 29b50d2 to 08a2a7a Compare October 28, 2021 13:58
@singh264

singh264 commented Oct 28, 2021 •

Copy link
Copy Markdown
Contributor Author

I think the verbose log message now begins with the string that is described by the TR_Vlog_INFO enum.

./build/linux-ppc64le-normal-server-release/images/j2sdk-image/bin/java -Xjit:verbose -version

#INFO:  Stopping compilation thread, vmThread pointer 00000000000A0100, thread ID 2
#INFO:  Stopping compilation thread, vmThread pointer 00000000000A7000, thread ID 5
#INFO:  Stopping compilation thread, vmThread pointer 00000000000A2600, thread ID 3
#INFO:  Stopping compilation thread, vmThread pointer 000000000009B700, thread ID 0
#INFO:  Stopping compilation thread, vmThread pointer 00000000000A4B00, thread ID 4
#INFO:  Stopping compilation thread, vmThread pointer 000000000009DC00, thread ID 1
#INFO:  Stopping compilation thread, vmThread pointer 00000000000A9500, thread ID 6
#INFO:  Stopping compilation thread, vmThread pointer 00000000000AB900, thread ID 7 

@singh264
singh264 requested a review from ymanton October 28, 2021 15:18

@ymanton ymanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please leave a comment in #421 describing your change and the output.

@ymanton

ymanton commented Oct 28, 2021

Copy link
Copy Markdown
Member

Jenkins test sanity.functional all jdk11

@mpirvu mpirvu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though some may argue that simply saying -Xjit:verbose should produce only the lines for compilation ends which are needed for a limitfile.

@singh264

singh264 commented Nov 1, 2021 •

Copy link
Copy Markdown
Contributor Author

I think the pull request could be merged.

@mpirvu

mpirvu commented Nov 1, 2021

Copy link
Copy Markdown
Contributor

@ymanton could you please approve this PR if you are satisfied with the current version?

@ymanton ymanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

All of the tests have passed despite Test_openjdk11_j9_sanity.functional_x86-64_mac_Personal showing as still running.

@mpirvu

mpirvu commented Nov 1, 2021

Copy link
Copy Markdown
Contributor

Merging based on the above comment

@mpirvu
mpirvu merged commit 0309663 into eclipse-openj9:master Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print a JIT compilation thread shutdown message in a verbose log

3 participants