RFR: 8296: No Java process should ever be PID 1

Henrik Dafgård hdafgard at openjdk.org
Fri Dec 6 15:03:19 UTC 2024


On Tue, 3 Dec 2024 13:07:06 GMT, Marcus Hirt <hirt at openjdk.org> wrote:

>> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/general/PID1Rule.java line 94:
>> 
>>> 92: 	@Override
>>> 93: 	public Collection<TypedResult<?>> getResults() {
>>> 94: 		return Collections.emptyList();
>> 
>> configuration attributes and results should be empty in this case, or?
>
> Hi Hendrik!
> 
> Great progress on the rule! Configuration attributes should be empty, since the rule is not configurable. For the result, you should at least return the score attribute (we'll make the API nicer for JMC 10), and even though we know the PID is one when the rule is triggering, perhaps we should add the PID attribute to the results as well. So, following the pattern of other rules, perhaps add:
> 
> 	private static final Collection<TypedResult<?>> RESULT_ATTRIBUTES = Arrays
> 			.<TypedResult<?>> asList(TypedResult.SCORE, PID);

I think this is fine actually, if we don't expect the output to ever be dynamic then this I don't see the need to add a result attribute.

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

PR Review Comment: https://git.openjdk.org/jmc/pull/613#discussion_r1870094560


More information about the jmc-dev mailing list