Skip to content

Commit

Permalink
Revert "8254711: Add java.security.Provider.getService JFR Event"
Browse files Browse the repository at this point in the history
This reverts commit 394a756.
  • Loading branch information
lutkerd committed Jul 18, 2024
1 parent d5247f1 commit 84e02c7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 286 deletions.
29 changes: 9 additions & 20 deletions src/java.base/share/classes/java/security/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package java.security;

import jdk.internal.event.SecurityProviderServiceEvent;

import java.io.*;
import java.util.*;
import static java.util.Locale.ENGLISH;
Expand Down Expand Up @@ -1236,28 +1234,19 @@ public Service getService(String type, String algorithm) {
key = new ServiceKey(type, algorithm, false);
previousKey = key;
}
Service s = null;
if (!serviceMap.isEmpty()) {
s = serviceMap.get(key);
}
if (s == null) {
synchronized (this) {
ensureLegacyParsed();
if (legacyMap != null && !legacyMap.isEmpty()) {
s = legacyMap.get(key);
}
Service s = serviceMap.get(key);
if (s != null) {
return s;
}
}

if (s != null && SecurityProviderServiceEvent.isTurnedOn()) {
var e = new SecurityProviderServiceEvent();
e.provider = getName();
e.type = type;
e.algorithm = algorithm;
e.commit();
synchronized (this) {
ensureLegacyParsed();
if (legacyMap != null && !legacyMap.isEmpty()) {
return legacyMap.get(key);
}
}

return s;
return null;
}

// ServiceKey from previous getService() call
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import jdk.internal.access.SharedSecrets;
Expand All @@ -49,7 +50,6 @@
import jdk.jfr.events.InitialSecurityPropertyEvent;
import jdk.jfr.events.ProcessStartEvent;
import jdk.jfr.events.SecurityPropertyModificationEvent;
import jdk.jfr.events.SecurityProviderServiceEvent;
import jdk.jfr.events.SocketReadEvent;
import jdk.jfr.events.SocketWriteEvent;
import jdk.jfr.events.TLSHandshakeEvent;
Expand All @@ -70,7 +70,6 @@ public final class JDKEvents {
DeserializationEvent.class,
ProcessStartEvent.class,
SecurityPropertyModificationEvent.class,
SecurityProviderServiceEvent.class,
TLSHandshakeEvent.class,
X509CertificateEvent.class,
X509ValidationEvent.class
Expand All @@ -90,7 +89,6 @@ public final class JDKEvents {
jdk.internal.event.DeserializationEvent.class,
jdk.internal.event.ProcessStartEvent.class,
jdk.internal.event.SecurityPropertyModificationEvent.class,
jdk.internal.event.SecurityProviderServiceEvent.class,
jdk.internal.event.TLSHandshakeEvent.class,
jdk.internal.event.X509CertificateEvent.class,
jdk.internal.event.X509ValidationEvent.class,
Expand Down
5 changes: 0 additions & 5 deletions src/jdk.jfr/share/conf/jfr/default.jfc
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,6 @@
<setting name="stackTrace">true</setting>
</event>

<event name="jdk.SecurityProviderService">
<setting name="enabled">false</setting>
<setting name="stackTrace">true</setting>
</event>

<event name="jdk.TLSHandshake">
<setting name="enabled">false</setting>
<setting name="stackTrace">true</setting>
Expand Down
5 changes: 0 additions & 5 deletions src/jdk.jfr/share/conf/jfr/profile.jfc
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,6 @@
<setting name="stackTrace">true</setting>
</event>

<event name="jdk.SecurityProviderService">
<setting name="enabled">false</setting>
<setting name="stackTrace">true</setting>
</event>

<event name="jdk.TLSHandshake">
<setting name="enabled">false</setting>
<setting name="stackTrace">true</setting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ private static Document createDocument(String content) throws ParserConfiguratio
insertSetting(doc, EventNames.JavaExceptionThrow, "threshold", "0 ns");
insertSetting(doc, EventNames.JavaErrorThrow, "threshold", "0 ns");
insertSetting(doc, EventNames.SecurityProperty, "threshold", "0 ns");
insertSetting(doc, EventNames.SecurityProviderService, "threshold", "0 ns");
insertSetting(doc, EventNames.TLSHandshake, "threshold", "0 ns");
insertSetting(doc, EventNames.X509Certificate, "threshold", "0 ns");
insertSetting(doc, EventNames.X509Validation, "threshold", "0 ns");
Expand Down
1 change: 0 additions & 1 deletion test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ private static void testSettingConfiguration(String configurationName) throws Ex
settingValues.put(EventNames.X509Validation + "#threshold", "0 ns");
settingValues.put(EventNames.ProcessStart + "#threshold", "0 ns");
settingValues.put(EventNames.Deserialization + "#threshold", "0 ns");
settingValues.put(EventNames.SecurityProviderService + "#threshold", "0 ns");

try (Recording recording = new Recording(c)) {
Map<Long, EventType> eventTypes = new HashMap<>();
Expand Down
157 changes: 0 additions & 157 deletions test/jdk/jdk/jfr/event/security/TestSecurityProviderServiceEvent.java

This file was deleted.

1 change: 0 additions & 1 deletion test/lib/jdk/test/lib/jfr/EventNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ public class EventNames {
public static final String X509Validation = PREFIX + "X509Validation";
public static final String InitialSecurityProperty = PREFIX + "InitialSecurityProperty";
public static final String SecurityProperty = PREFIX + "SecurityPropertyModification";
public final static String SecurityProviderService = PREFIX + "SecurityProviderService";
public static final String DirectBufferStatistics = PREFIX + "DirectBufferStatistics";
public static final String Deserialization = PREFIX + "Deserialization";

Expand Down

0 comments on commit 84e02c7

Please sign in to comment.