RFR: 8221730: jcmd process name matching broken
Jean Christophe Beyler
jcbeyler at google.com
Wed Apr 3 20:41:12 UTC 2019
Hi Daniil,
Looks good to me. Two commas missing in the comments it seems:
+ * was started with <em>-m</em> or <em>--module</ew> option the method
returns
->
+ * was started with <em>-m</em> or <em>--module</ew> option, the
method returns
and
+ // To be consistent with the behavior on other platforms, if -jar,
-m or --module
->
+ // To be consistent with the behavior on other platforms, if -jar,
-m, or --module
Evidently no need to send anything for me (and you can ignore the fixes too
:-)),
Jc
On Wed, Apr 3, 2019 at 1:25 PM Daniil Titov <daniil.x.titov at oracle.com>
wrote:
> Resending the RFR for 8221730, since the formatting in the original email
> wad corrupted.
>
> Please review the change that makes jcmd process name matching on Linux
> platform consistent with pre-existing behavior. On other platforms the
> jcmd uses system property "sun.rt.javaCommand" (see sun.jvmstat.monitor.
> MonitoredVmUtil.mainClass(MonitoredVm, boolean) that is called from
> sun.tools.common. ProcessArgumentMatcher at line 96) and treats the part
> before the first space as a main class when matching the process name.
> However, if the application is started with -jar option this part contains
> the path to the jar file. If -m or --module option is used this part
> contains the module name and the main class (if the main class was
> specified in the command line) in the format <modulename>/<mainclass>.
> After changes JDK-8205654 , on Linux platform the proc filesystem is used
> to find a Java process, however, it always matches the main class argument
> against the main class regardless what options were used to launch the
> application. This created discrepancies between old an!
> d new behavior on Linux platform as well as between behavior on Linux and
> other platforms. The fix changes sun.tool.ProcessHelper (that was
> introduced in [3]) to correct these discrepancies.
>
> Webrev: http://cr.openjdk.java.net/~dtitov/8221730/webrev.01
> Bug: https://bugs.openjdk.java.net/browse/JDK-8221730
>
> Thanks!
> --Daniil
>
>
>
>
>
>
--
Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190403/c7deb58f/attachment.html>
More information about the serviceability-dev
mailing list