The mode parameter for jdk.internal.perf.Perf.attach() has never supported the value "rw" since the source code was imported to the openjdk repo more than 15 years ago. In fact HotSpot throws IllegalArgumentException when such a mode is specified.
It's unlikely such a mode will be required for future enhancements. Support for "rw" should be removed. The "mode" parameter should also be removed, since now "r" would be the only supported mode.
================
https://github.com/openjdk/jdk/blame/master/src/java.base/share/classes/jdk/internal/perf/Perf.java#L179-L207
* The attach mode specifies the access permissions requested for the
* instrumentation buffer of the target virtual machine. The permitted
* access permissions are:
* <ul>
* <li>"r" - Read only access. This Java virtual machine has only
* read access to the instrumentation buffer for the target Java
* virtual machine.
* <li>"rw" - Read/Write access. This Java virtual machine has read and
* write access to the instrumentation buffer for the target Java virtual
* machine. This mode is currently not supported and is reserved for
* future enhancements.
* </ul>
....
*/
public ByteBuffer attach(int lvmid, String mode)
throws IllegalArgumentException, IOException
{
if (mode.compareTo("r") == 0) {
return attachImpl(null, lvmid, PERF_MODE_RO);
}
else if (mode.compareTo("rw") == 0) {
return attachImpl(null, lvmid, PERF_MODE_RW);
}
It's unlikely such a mode will be required for future enhancements. Support for "rw" should be removed. The "mode" parameter should also be removed, since now "r" would be the only supported mode.
================
https://github.com/openjdk/jdk/blame/master/src/java.base/share/classes/jdk/internal/perf/Perf.java#L179-L207
* The attach mode specifies the access permissions requested for the
* instrumentation buffer of the target virtual machine. The permitted
* access permissions are:
* <ul>
* <li>"r" - Read only access. This Java virtual machine has only
* read access to the instrumentation buffer for the target Java
* virtual machine.
* <li>"rw" - Read/Write access. This Java virtual machine has read and
* write access to the instrumentation buffer for the target Java virtual
* machine. This mode is currently not supported and is reserved for
* future enhancements.
* </ul>
....
*/
public ByteBuffer attach(int lvmid, String mode)
throws IllegalArgumentException, IOException
{
if (mode.compareTo("r") == 0) {
return attachImpl(null, lvmid, PERF_MODE_RO);
}
else if (mode.compareTo("rw") == 0) {
return attachImpl(null, lvmid, PERF_MODE_RW);
}
- relates to
-
JDK-8286560 Remove user parameter from jdk.internal.perf.Perf.attach()
- Resolved
-
JDK-8276687 Remove support for JDK 1.4.1 PerfData shared memory files
- Resolved