PrintAssembly at runtime / to different target
Stefan Reich
stefan.reich.maker.of.eye at googlemail.com
Mon Sep 16 22:29:58 UTC 2019
Oh, now it seems to work, thanks. It does print the assembly BOTH on STDOUT
and in the XML log file. What's this affiliation the JVM has with STDOUT? :D
~/dev/jdk-13-src/jdk13/build/linux-x86_64-server-fastdebug/jdk/bin/java \
-XX:+UnlockDiagnosticVMOptions \
-XX:+PrintAssembly -XX:PrintAssemblyOptions=intel \
-XX:LogFile=the.log \
-cp ../javacpp.jar:. Dot >hotspot-intel.out
On Tue, 17 Sep 2019 at 00:21, Vitaly Davidovich <vitalyd at gmail.com> wrote:
> What if you specify -XX:LogFile=/path/to/file? It should then send output
> there.
>
> On Mon, Sep 16, 2019 at 12:35 PM Stefan Reich <
> stefan.reich.maker.of.eye at googlemail.com> wrote:
>
>> Oops, too many lines copied, please ignore. This is the actual log:
>>
>> root at vmd41736:~/dev/ii-assembly# java13-dbg -version
>> openjdk version "13-internal" 2019-09-17
>> OpenJDK Runtime Environment (fastdebug build
>> 13-internal+0-adhoc.root.jdk13)
>> OpenJDK 64-Bit Server VM (fastdebug build 13-internal+0-adhoc.root.jdk13,
>> mixed mode)
>> root at vmd41736:~/dev/ii-assembly# java13-dbg
>> -XX:+UnlockDiagnosticVMOptions
>> -XX:+LogCompilation -XX:+PrintAssembly -jar ~/.javax/x30.jar -noawt
>> 1025248
>> >hotspot.out
>> OpenJDK 64-Bit Server VM warning: PrintAssembly is enabled; turning on
>> DebugNonSafepoints to gain additional output
>> WARNING: An illegal reflective access operation has occurred
>> WARNING: Illegal reflective access by x30 (file:/root/.javax/x30.jar) to
>> method java.lang.Object.registerNatives()
>> WARNING: Please consider reporting this to the maintainers of x30
>> WARNING: Use --illegal-access=warn to enable warnings of further illegal
>> reflective access operations
>> WARNING: All illegal access operations will be denied in a future release
>> root at vmd41736:~/dev/ii-assembly# ls -ltrh
>> total 184M
>> -rw-r--r-- 1 root root 42M Sep 16 18:26 hotspot.out
>> -rw-r--r-- 1 root root 46M Sep 16 18:26 hotspot_pid15548.log
>> root at vmd41736:~/dev/ii-assembly# grep mov hotspot.out
>> hotspot_pid15548.log|head -5
>> hotspot.out: ;; move 0 -> 2
>> hotspot.out:000 movl rscratch1, [j_rarg0 +
>> oopDesc::klass_offset_in_bytes()]
>> # compressed klass
>> hotspot.out: movq rscratch1, poll_offset[r15_thread]
>> #polling_page_address
>> hotspot.out:000 movl rscratch1, [j_rarg0 +
>> oopDesc::klass_offset_in_bytes()]
>> # compressed klass
>> hotspot.out:02c movsbl R10, [RSI + #20 (8-bit)] # byte ! Field:
>> java/lang/String.coder (constant)
>>
>> On Mon, 16 Sep 2019 at 18:31, Stefan Reich <
>> stefan.reich.maker.of.eye at googlemail.com> wrote:
>>
>> > Hmm. I built JDK 13 from Mercurial with fastdebug, and it always sends
>> > assembly output to tty.
>> >
>> > root at vmd41736:~/dev/ii-assembly# java13-dbg -version
>> > openjdk version "13-internal" 2019-09-17
>> > OpenJDK Runtime Environment (fastdebug build
>> > 13-internal+0-adhoc.root.jdk13)
>> > OpenJDK 64-Bit Server VM (fastdebug build
>> 13-internal+0-adhoc.root.jdk13,
>> > mixed mode)
>> > root at vmd41736:~/dev/ii-assembly# java13-dbg
>> > -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:+PrintAssembly
>> -jar
>> > ~/.javax/x30.jar -noawt 1025248 >ii-assembly.out
>> > OpenJDK 64-Bit Server VM warning: PrintAssembly is enabled; turning on
>> > DebugNonSafepoints to gain additional output
>> > WARNING: An illegal reflective access operation has occurred
>> > WARNING: Illegal reflective access by x30 (file:/root/.javax/x30.jar) to
>> > method java.lang.Object.registerNatives()
>> > WARNING: Please consider reporting this to the maintainers of x30
>> > WARNING: Use --illegal-access=warn to enable warnings of further illegal
>> > reflective access operations
>> > WARNING: All illegal access operations will be denied in a future
>> release
>> > root at vmd41736:~/dev/ii-assembly# java13-dbg
>> > -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:+PrintAssembly
>> -jar
>> > ~/.javax/x30.jar -noawt 1025248 >hotspot.out
>> > OpenJDK 64-Bit Server VM warning: PrintAssembly is enabled; turning on
>> > DebugNonSafepoints to gain additional output
>> > WARNING: An illegal reflective access operation has occurred
>> > WARNING: Illegal reflective access by x30 (file:/root/.javax/x30.jar) to
>> > method java.lang.Object.registerNatives()
>> > WARNING: Please consider reporting this to the maintainers of x30
>> > WARNING: Use --illegal-access=warn to enable warnings of further illegal
>> > reflective access operations
>> > WARNING: All illegal access operations will be denied in a future
>> release
>> > root at vmd41736:~/dev/ii-assembly# ls -ltrh
>> > total 184M
>> > -rw-r--r-- 1 root root 42M Sep 16 18:26 hotspot.out
>> > -rw-r--r-- 1 root root 46M Sep 16 18:26 hotspot_pid15548.log
>> > root at vmd41736:~/dev/ii-assembly# grep mov hotspot.out
>> > hotspot_pid15548.log|head -5
>> > hotspot.out: ;; move 0 -> 2
>> > hotspot.out:000 movl rscratch1, [j_rarg0 +
>> > oopDesc::klass_offset_in_bytes()] # compressed klass
>> > hotspot.out: movq rscratch1, poll_offset[r15_thread]
>> > #polling_page_address
>> > hotspot.out:000 movl rscratch1, [j_rarg0 +
>> > oopDesc::klass_offset_in_bytes()] # compressed klass
>> > hotspot.out:02c movsbl R10, [RSI + #20 (8-bit)] # byte ! Field:
>> > java/lang/String.coder (constant)
>> >
>> > On Mon, 16 Sep 2019 at 18:24, Aleksey Shipilev <shade at redhat.com>
>> wrote:
>> >
>> >> On 9/16/19 6:18 PM, Stefan Reich wrote:
>> >> > How can I get assembly output in hotspot.log though? I only ever see
>> it
>> >> on STDOUT, even with
>> >> > LogCompilation enabled.
>> >>
>> >> LogCompilation has to include output that would otherwise would end up
>> on
>> >> tty. It would be captured
>> >> in <tty> there.
>> >>
>> >> JMH -prof perfasm does use LogCompilation to get disassembly like this:
>> >>
>> >>
>> http://hg.openjdk.java.net/code-tools/jmh/file/99d7b73cf1e3/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java#l239
>> >>
>> >> --
>> >> Thanks,
>> >> -Aleksey
>> >>
>> >>
>> >
>> > --
>> > Stefan Reich
>> > BotCompany.de // Java-based operating systems
>> >
>>
>>
>> --
>> Stefan Reich
>> BotCompany.de // Java-based operating systems
>>
> --
> Sent from my phone
>
--
Stefan Reich
BotCompany.de // Java-based operating systems
More information about the hotspot-dev
mailing list