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

Remove isAOT check in order to enable relo logging for JITServer #4445

Merged
merged 1 commit into from
Nov 19, 2019

Conversation

dchopra001
Copy link
Contributor

Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com

@dchopra001
Copy link
Contributor Author

dchopra001 commented Oct 11, 2019

@mpirvu Can I get a review please?

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

Previoulsy, the tracing was done only for AOT compilations. After your change, with the right options, tracing can be done for any method and I assume this will work because if there is no relocation data, nothing will be printed.
I would like some validation/reassurance that cg->getAheadOfTimeCompile() is always non-null.

@dchopra001 dchopra001 mentioned this pull request Oct 16, 2019
6 tasks
Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@dchopra001
Copy link
Contributor Author

dchopra001 commented Oct 28, 2019

@mpirvu The constructor in OMR's CodeGenerator class initializes _aheadOfTimeCompile too NULL.

The z, p, aarch64 and x codgens in OpenJ9 unconditionally initialize the _aheadOfTimeCompile field. Here's an example on Power:
https://github.com/eclipse/openj9/blob/14754c255f9b47bb3d7f664196612e48c1a2adb7/runtime/compiler/p/codegen/J9CodeGenerator.cpp#L54

So I guess technically it's possible for cg->getAheadOfTimeCompile() to be null. I didn't see this issue because I've only debugged in OpenJ9 for x, p, and z so far.

Therefore I've added a cg->getAheadOfTimeCompile() guard here. This should allow relocation tracing to be enabled for remote as well as AOT compiles, and only if the cg->getAheadOfTimeCompile() object exists.

Please take a look.

@mpirvu
Copy link
Contributor

mpirvu commented Oct 28, 2019

Since cg->getAheadOfTimeCompile() always returns non-null value, it follows that dumpRelocationData(); will always be executed when comp->getOption(TR_TraceRelocatableDataCG) || comp->getOption(TR_TraceRelocatableDataDetailsCG) || comp->getOption(TR_TraceReloCG) returns true. If that is safe to do for non-AOT compilations, then I am ok with this change.

Therefore, I am suggesting a test, non-AOT, non-JITServer, with one the options above enabled.

@dchopra001
Copy link
Contributor Author

dchopra001 commented Nov 14, 2019

@mpirvu
I just ran a test with the following command line options:

jvm/jre/bin/java -Xjit:count=0,{*HashMap*}\(traceFull,traceCG,log=trace.log,traceRelocatableDataCG,traceRelocatableDataDetailsCG,traceRelocatableDataDetailsRT,traceRelocatableDataRT,traceReloCG\),verbose,vlog=vlog,rtlog=rtlog_name,aotrtDebugLevel=9 -version

and I see the following output in the trace log

<relocatableDataCG>
Code start =        0, Method start pc = b41356fc, Method start pc offset = 0xb41356fc
No relocation data allocated
</relocatableDataCG>

And obviously there are no crashes.

So it looks like we should be okay to merge this.

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

@fjeremic fjeremic self-assigned this Nov 19, 2019
@fjeremic
Copy link
Contributor

@genie-omr build all

@fjeremic fjeremic merged commit 3674f0b into eclipse-omr:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants