Re: RFR: 8254723: add diagnostic command to write Linux perf map file [v5]
On Tue, 27 Oct 2020 04:21:33 GMT, Nick Gasson wrote: >> When using the Linux "perf" tool to do system profiling, symbol names of >> running Java methods cannot be decoded, resulting in unhelpful output >> such as: >> >> 10.52% [JIT] tid 236748 [.] 0x7f6fdb75d223 >> >> Perf can read a simple text file format describing the mapping between >> address ranges and symbol names for a particular process [1]. >> >> It's possible to generate this already for Java processes using a JVMTI >> plugin such as perf-map-agent [2]. However this requires compiling >> third-party code and then loading the agent into your Java process. It >> would be more convenient if Hotspot could write this file directly using >> a diagnostic command. The information required is almost identical to >> that of the existing Compiler.codelist command. >> >> This patch adds a Compiler.perfmap diagnostic command on Linux only. To >> use, first run "jcmd Compiler.perfmap" and then "perf top" or >> "perf record" and the report should show decoded Java symbol names for >> that process. >> >> As this just writes a snapshot of the code cache when the command is >> run, it will become stale if methods are compiled later or unloaded. >> However this shouldn't be a big problem in practice if the map file is >> generated after the application has warmed up. >> >> [1] >> https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt >> [2] https://github.com/jvm-profiling-tools/perf-map-agent > > Nick Gasson has updated the pull request incrementally with one additional > commit since the last revision: > > Make DumpPerfMapAtExit a diagnostic option Ok, I reviewed this change. I guess you should close [JDK-8254723](https://bugs.openjdk.java.net/browse/JDK-8254723). - Marked as reviewed by ysuenaga (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/760
Re: RFR: 8254723: add diagnostic command to write Linux perf map file [v5]
On Fri, 30 Oct 2020 04:34:19 GMT, Yasumasa Suenaga wrote: > > Sure, the change looks good to me. However I don't understand why CSR is not > needed. It introduces new dcmd for Linux. I think because interfaces that are for diagnostic purposes don't require a CSR. See question 4 on the CSR FAQs: https://wiki.openjdk.java.net/display/csr/CSR+FAQs - PR: https://git.openjdk.java.net/jdk/pull/760
Re: RFR: 8254723: add diagnostic command to write Linux perf map file [v5]
On Wed, 21 Oct 2020 04:35:14 GMT, Yasumasa Suenaga wrote: >> Nick Gasson has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Make DumpPerfMapAtExit a diagnostic option > > Changes requested by ysuenaga (Reviewer). > @YaSuenag could you re-review the latest changes? Sure, the change looks good to me. However I don't understand why CSR is not needed. It introduces new dcmd for Linux. - PR: https://git.openjdk.java.net/jdk/pull/760
Re: RFR: 8254723: add diagnostic command to write Linux perf map file [v5]
On Wed, 21 Oct 2020 04:35:14 GMT, Yasumasa Suenaga wrote: >> Nick Gasson has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Make DumpPerfMapAtExit a diagnostic option > > Changes requested by ysuenaga (Reviewer). @YaSuenag could you re-review the latest changes? - PR: https://git.openjdk.java.net/jdk/pull/760
Re: RFR: 8254723: add diagnostic command to write Linux perf map file [v5]
> When using the Linux "perf" tool to do system profiling, symbol names of > running Java methods cannot be decoded, resulting in unhelpful output > such as: > > 10.52% [JIT] tid 236748 [.] 0x7f6fdb75d223 > > Perf can read a simple text file format describing the mapping between > address ranges and symbol names for a particular process [1]. > > It's possible to generate this already for Java processes using a JVMTI > plugin such as perf-map-agent [2]. However this requires compiling > third-party code and then loading the agent into your Java process. It > would be more convenient if Hotspot could write this file directly using > a diagnostic command. The information required is almost identical to > that of the existing Compiler.codelist command. > > This patch adds a Compiler.perfmap diagnostic command on Linux only. To > use, first run "jcmd Compiler.perfmap" and then "perf top" or > "perf record" and the report should show decoded Java symbol names for > that process. > > As this just writes a snapshot of the code cache when the command is > run, it will become stale if methods are compiled later or unloaded. > However this shouldn't be a big problem in practice if the map file is > generated after the application has warmed up. > > [1] > https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt > [2] https://github.com/jvm-profiling-tools/perf-map-agent Nick Gasson has updated the pull request incrementally with one additional commit since the last revision: Make DumpPerfMapAtExit a diagnostic option - Changes: - all: https://git.openjdk.java.net/jdk/pull/760/files - new: https://git.openjdk.java.net/jdk/pull/760/files/959adca5..d8a399a1 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk=760=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk=760=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/760.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/760/head:pull/760 PR: https://git.openjdk.java.net/jdk/pull/760