Making PrintEscapeAnalysis a diagnostic option on product VM?

Chris Newland cnewland at chrisnewland.com
Thu Jul 9 20:49:56 UTC 2015


Please ignore previous message.

All this time I've been digging around the connection graph logging in
escape.cpp when I should have been looking in macro.cpp.

I believe the BCI information I need is actually already output by
PhaseMacroExpand::eliminate_allocate_node() so I'll attempt to visualise
this in JITWatch and submit a patch if I need anything further.

Thanks,

Chris

On Thu, July 9, 2015 21:10, Chris Newland wrote:
> Hi,
>
>
> I've found a way to output EA information via LogCompilation from the
> product VM including BCIs so that I can annotate bytecode but it relies on
>  the following block from opto/compile.cpp being entered:
>
> void Compile::Init(int aliaslevel) { ...
>
>
> if (debug_info()->recording_non_safepoints()) {
> set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*>
> (comp_arena(), 8, 0, NULL));
> set_default_node_notes(Node_Notes::make(this));
> }
>
>
> Without this, the Note_Notes are not present in the ideal nodes and I
> can't fully identify what was eliminated.
>
> It looks like this will only execute when DebugNonSafepoints is true and
> this is a diagnostic VM option.
>
> Does anyone have an alternative method for getting BCIs for eliminated
> allocs without using Note_Notes?
>
> Thanks,
>
>
> Chris
>
>
>
>
>
> On Fri, June 19, 2015 16:09, Vladimir Kozlov wrote:
>
>> Agree.
>>
>>
>>
>> Vladimir K
>>
>>
>>
>> On 6/19/15 5:10 AM, Vladimir Ivanov wrote:
>>
>>
>>>> What do you think the next step is?
>>>>
>>>>
>>>>
>>>> I'm not a committer but I'd be happy to submit a patch/webrev that
>>>> outputs LogCompilation XML for the kind of EA info I think would be
>>>> useful.
>>> Go for it. If you are a Contributor (signed OCA), we'll review and
>>> accept your patch with gratitude. Keep in mind, that when you touch
>>> LogCompilation output format, you should update logc tool
>>> (src/share/tools/LogCompilation/ [1]) as well.
>>>
>>>
>>>
>>>> I've just seen Vitaly's post and I agree a tty 1-liner for each
>>>> elimination would also be nice.
>>> Feel free to enhance -XX:+PrintEscapeAnalysis output as well, if you
>>> find it useful.
>>>
>>> Best regards,
>>> Vladimir Ivanov
>>>
>>>
>>>
>>> [1]
>>> http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/tip/src/share/tools/
>>> L
>>> ogCompilation
>>>>
>>>> Thanks,
>>>>
>>>>
>>>>
>>>> Chris
>>>>
>>>>
>>>>
>>>> On Fri, June 19, 2015 12:03, Vladimir Ivanov wrote:
>>>>
>>>>
>>>>> Chris,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I'd suggest to look into enhancing LogCompilation output instead
>>>>> of parsing VM output. It doesn't require any flag changes and fits
>>>>>  nicely into existing LogCompilation functionality, so we can
>>>>> integrate it into the product, relieving you and JITWatch users
>>>>> from building a companion VM.
>>>>>
>>>>> Best regards,
>>>>> Vladimir Ivanov
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 6/19/15 1:16 PM, Chris Newland wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hi, hope this is the correct list (perhaps serviceability?)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I'm experimenting with some HotSpot changes that log escape
>>>>>> analysis decisions so that I can visualise eliminated
>>>>>> allocations at the source and bytecode levels in JITWatch[1].
>>>>>>
>>>>>> My plan was to build a companion VM for JITWatch based on the
>>>>>> product VM that would allow users to inspect some of the deeper
>>>>>> workings such as EA and DCE that are not present in the
>>>>>> LogCompilation output.
>>>>>>
>>>>>>
>>>>>> I mentioned this to some performance guys at Devoxx and they
>>>>>> didn't like the custom VM idea and suggested I put in a request
>>>>>> to consider making -XX:+PrintEscapeAnalysis available under
>>>>>> -XX:+UnlockDiagnosticVMOptions on
>>>>>> the product VM (it's currently a notproduct option).
>>>>>>
>>>>>> If this is something you would consider than could I also
>>>>>> request consideration of -XX:+PrintEliminateAllocations.
>>>>>>
>>>>>> All I would need is the class, method, and bci of each NoEscape
>>>>>>  detected.
>>>>>>
>>>>>> Kind regards,
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> [1] https://github.com/AdoptOpenJDK/jitwatch
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>
>
>
>




More information about the hotspot-compiler-dev mailing list