RFR: 8222000: JFR: Process start event

Roger Riggs Roger.Riggs at oracle.com
Thu Mar 5 18:02:05 UTC 2020

Hi Erik,

The update looks fine.

On 3/5/20 12:21 PM, Erik Gahlin wrote:
> Hi Roger,
> Thanks for the feedback.
> Runtime.exec doesn't take arg[0] as a separate parameter, so it may 
> make sense to not split it up in the event. For example, if plan is to 
> execute "hg clone url", but the user forgets to add "hg", then it will 
> look as if "clone" is the command, which could be confusing.
The main interface for launching processes is ProcessBuilder. 
Runtime.exec is a legacy interface and no longer drives the terminology.
> I will change the field name to 'command' to make it consistent with 
> the single arg form of Runtime.exec.
> Regarding delimiters, I think there are two use cases. Making 
> something easy for humans to read and making it unambiguous for 
> machine parsing. Since comma, or comma space, might be part of an 
> argument, it is still unsafe for a parser. It would be possible to add 
> escape sequences, but then it would be even harder for humans to read, 
> which I think is the main use case. If we in the future would add 
> support for serializing a String[], we could add another field, i.e. 
> commandArray, which would work for machines without special parse logic.
understood, it wasn't clear what the focus of a string in the JFR stream 
is intended to mean or how it would be interpreted. I'm thinking that 
more and more it will be tools and AI's (not people) that will be 
looking through the reams and reams of output at scale.
> There is no ProcessEnd event today, but that is something that could 
> be added in the future. The exit status could be useful.
one step at a time.

Thanks, Roger
> Updated webrev:
> http://cr.openjdk.java.net/~egahlin/8222000/
> Thanks
> Erik
> On 2020-03-05 15:27, Roger Riggs wrote:
>> Hi Erik,
>> Would the event be more useful if the executable arg[0] was a 
>> separate field from the arguments?
>> Though I exect it depends on what is later evaluating the event fields.
>> If all of cmdarrray is being joined, then the event field name is 
>> more appropriately
>> called 'command';  similar to the single arg form of Runtime.exec and 
>> new ProcessBuilder(...).
>> A small point but the joining with ' ' space has the usual problem of 
>> trying to parse out the arguments later.
>> using ',' comma might be less ambiguous.  (and Arrays.toString).
>> Otherwise, looks fine to me.
>> Is there already a Process exited event? Its not quite as convenient 
>> to instrument but useful if it captures the exit status. (ProcessImpl 
>> - Windows and Linux versions).
>> Roger
>> On 3/5/20 9:10 AM, Erik Gahlin wrote:
>>> Hi
>>> Could I have review of a JFR event that is emitted when a process is 
>>> started from Java.
>>> Bug:
>>> https://bugs.openjdk.java.net/browse/JDK-8222000
>>> Webrev:
>>> http://cr.openjdk.java.net/~egahlin/8222000/
>>> Testing:
>>> tier1,tier2 + jdk/jdk/jfr
>>> Thanks
>>> Erik

More information about the core-libs-dev mailing list