PrintAssembly at runtime / to different target
Vitaly Davidovich
vitalyd at gmail.com
Mon Sep 16 22:21:47 UTC 2019
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
More information about the hotspot-dev
mailing list