[8u] RFR: 8220657: JFR.dump does not work when filename is set

Ekaterina Vergizova katya at azul.com
Thu Aug 6 07:11:51 UTC 2020


Hi Andrew,
the method getRealPathText() is introduced by 8224217 which is already approved and included into jdk8u-dev [1].
So the proposed 8220657 patch build successfully against the latest jdk8u-dev.

In 11u these patches were applied in reverse order, that's why some additional modifications with getText()/getRealPathText() were required for both of them.

Thanks, Ekaterina

[1] https://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/87091b543626

From: Andrew Hughes <gnu.andrew at redhat.com>
Sent: Thursday, August 6, 2020 5:48 AM
To: Ekaterina Vergizova <katya at azul.com>
Cc: jdk8u-dev at openjdk.java.net
Subject: Re: [8u] RFR: 8220657: JFR.dump does not work when filename is set


On 20:04 Thu 30 Jul     , Ekaterina Vergizova wrote:
> Hello,
> I would like to backport JFR issue 8220657 to 8u.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8220657
> Original patch: https://hg.openjdk.java.net/jdk/jdk/rev/bd613b97c7c8
> Webrev for 8u: https://cr.openjdk.java.net/~apetushkov/jfr_backports_katya/8220657/webrev.00/
>
> The patch applies cleanly, but the added test TestJcmdDumpWithFileName.java requires some adjustments to pass under 8u:

> - the test tags are adjusted
> - ProcessHandle.current().pid() calls replaced by ProcessTools.getProcessId()
> - Path.of() calls replaced by their 8u analogue Paths.get()
> - unsupported syntax `try (stream)` replaced by standard try-with-resources
>
> Tested with tier1 and jdk.jfr tests on Linux and Windows, the added test TestJcmdDumpWithFileName.java failed before the fix and passes after.

>
> Thanks,
> Ekaterina
>

This patch doesn't build:

Compiling 9722 files for BUILD_JDK
(/usr/lib/jvm/java-1.8.0-openjdk/bin/java -Xms64M -Xmx1600M -XX:ThreadStackSize=1536 "-Xbootclasspath/p:/home/ahughes/builder/8u-dev/langtools/dist/bootstrap/lib/javac.jar" -cp /home/ahughes/builder/8u-dev/langtools/dist/bootstrap/lib/javac.jar com.sun.tools.javac.Main -bootclasspath /home/ahughes/builder/8u-dev/jdk/classes -source 8 -target 8 -encoding ascii -XDignore.symbol.file=true -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs -Werror -g  -implicit:none -sourcepath "/home/ahughes/projects/openjdk/upstream/jdk8u-dev/jdk/src/share/classes:/home/ahughes/projects/openjdk/upstream/jdk8u-dev/jdk/src/solaris/classes:/home/ahughes/builder/8u-dev/jdk/gensrc:/home/ahughes/builder/8u-dev/jdk/gensrc_no_srczip" -d /home/ahughes/builder/8u-dev/jdk/classes -h /home/ahughes/builder/8u-dev/jdk/gensrc_headers.BUILD_JDK.tmp @/home/ahughes/builder/8u-dev/jdk/classes/_the.BUILD_JDK_batch.tmp && /usr/bin/mv /home/ahughes/builder/8u-dev/jdk/classes/_the.BUILD_JDK_batch.tmp /home/ahughes/builder/8u-dev/jdk/classes/_the.BUILD_JDK_batch)

/home/ahughes/projects/openjdk/upstream/jdk8u-dev/jdk/src/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java:161: error: cannot find symbol

 reportOperationComplete("Dumped", name, new SafePath(wup.getRealPathText()));
                                                          ^
  symbol:   method getRealPathText()
  location: variable wup of type WriteableUserPath

My attention was drawn to this even before building, because, in
comparing the 11u version of this patch with this proposed 8u one,
this line was changed for the 8u backport:

@@ -75,15 +64,13 @@
+                wup = new WriteableUserPath(safe.toPath());
+            }
+            r.dumpStopped(wup);
-+            reportOperationComplete("Dumped", name, new SafePath(wup.getText()));
++            reportOperationComplete("Dumped", name, new SafePath(wup.getRealPathText()));

something which wasn't explained in the above, and, indeed,
I see no getRealPathText method in the 8u codebase.

Thanks,
--
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list