RFR: 8257424: Add setName() to RecordingStream

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Dec 1 00:22:57 UTC 2020


On Mon, 30 Nov 2020 23:10:13 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> `RecordingStream` will start new flight recording to gather events. It has some of methods which are equivalent to `Recording`, but we cannot set recording name.
>> 
>> If we can specify the name for `RecordingStream`, it is useful to distinguish recordings by JFR.check dcmd.
>
> The underlying recording is an implementation detail, not sure it should show up in jcmd at all. Also, RemoteRecordingStream and RecordingStream should be interchangeable and setting the name on RemoteRecordingStream will not work with the current implementation. 
> 
> We have deliberately not added methods in Recording to RecordingStream and kept the API to the bare minimum Many of the methods are trivial to implement, but we don't want to commit on them yet. Instead we like to get the overall architecture correct and there still things we need to figure out.

`RemoteRecordingStream` would set the specified recording name.
https://github.com/openjdk/jdk/blob/master/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L278

> The underlying recording is an implementation detail, not sure it should show up in jcmd at all. 

If so, why `RemoteRecordingStream` will set the name?

> Also, RemoteRecordingStream and RecordingStream should be interchangeable and setting the name on RemoteRecordingStream will not work with the current implementation.

I think we can add `setName()` to both `RecordingStream` and `RemoteRecordingStream`, and also it is nature because `RemoteRecordingStream` will set specified name in current behavior.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1520


More information about the hotspot-jfr-dev mailing list