RFR: 8254711: Add java.security.Provider.getService JFR Event

Sean Coffey coffeys at openjdk.org
Mon Sep 19 15:45:50 UTC 2022


On Mon, 19 Sep 2022 14:25:55 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Add a JFR Event for `java.security.Provider.getService(String type, String algorithm)` calls.
>
> src/java.base/share/classes/java/security/Provider.java line 1293:
> 
>> 1291:         }
>> 1292: 
>> 1293:         if (s != null && SecurityProviderServiceEvent.isTurnedOn()) {
> 
> Would it be useful to generate an event even for the cases where a call to this method was made but no service was available and `null` was returned? The event perhaps could capture  that there was no service found for such type/algorithm combination? That would help identify usages in applications where there might be fallbacks being used when this method returns null?

I had this as the original design actually. I'm not sure how interesting it would be to record such "no-service" type events. It would probably add 2-4 times the number of events for this event type to a typical recording, given that the framework iterates over the providers in preferential order.

> src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java line 32:
> 
>> 30: 
>> 31: import jdk.jfr.Event;
>> 32: import jdk.jfr.events.*;
> 
> Hello Sean, rest of the changes look fine to me, except this one. Was this an intentional change to use `*` import instead of the explicit ones?

This was formatted via IDE. Seems like you've a preference to use the more verbose import style. I'll revert this change.

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

PR: https://git.openjdk.org/jdk/pull/9657



More information about the security-dev mailing list