Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,9 +36,8 @@
@Label("Deserialization")
@Name("jdk.Deserialization")
@Description("Results of deserialization and ObjectInputFilter checks")
@MirrorEvent(className = "jdk.internal.event.DeserializationEvent")
@RemoveFields("duration")
public final class DeserializationEvent extends AbstractJDKEvent {
public final class DeserializationEvent extends MirrorEvent {

@Label("Filter Configured")
public boolean filterConfigured;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,9 +36,8 @@
@Label("Java Error")
@Category("Java Application")
@Description("An object derived from java.lang.Error has been created. OutOfMemoryErrors are ignored")
@MirrorEvent(className = "jdk.internal.event.ErrorThrownEvent")
@RemoveFields("duration")
public final class ErrorThrownEvent extends AbstractJDKEvent {
public final class ErrorThrownEvent extends MirrorEvent {

@Label("Message")
public String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
import jdk.jfr.Name;
import jdk.jfr.StackTrace;
import jdk.jfr.internal.MirrorEvent;
import jdk.jfr.internal.RemoveFields;
import jdk.jfr.internal.Type;

@Name(Type.EVENT_NAME_PREFIX + "ExceptionStatistics")
@Label("Exception Statistics")
@Category({ "Java Application", "Statistics" })
@Description("Number of objects derived from java.lang.Throwable that have been created")
@MirrorEvent(className = "jdk.internal.event.ExceptionStatisticsEvent")
public final class ExceptionStatisticsEvent extends AbstractPeriodicEvent {
@RemoveFields({"duration", "eventThread", "stackTrace"})
public final class ExceptionStatisticsEvent extends MirrorEvent {

@Label("Exceptions Created")
public long throwables;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,9 +37,8 @@
@Label("Java Exception")
@Category("Java Application")
@Description("An object derived from java.lang.Exception has been created")
@MirrorEvent(className = "jdk.internal.event.ExceptionThrownEvent")
@RemoveFields("duration")
public final class ExceptionThrownEvent extends AbstractJDKEvent {
public final class ExceptionThrownEvent extends MirrorEvent {

@Label("Message")
public String message;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,10 +36,9 @@
@Label("Process Start")
@Name("jdk.ProcessStart")
@Description("Operating system process started")
@MirrorEvent(className = "jdk.internal.event.ProcessStartEvent")
@RemoveFields("duration")
@StackFilter({"java.lang.ProcessBuilder", "java.lang.Runtime::exec"})
public final class ProcessStartEvent extends AbstractJDKEvent {
public final class ProcessStartEvent extends MirrorEvent {
@Label("Process Id")
public long pid;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,10 +33,9 @@
@Label("Security Property Modification")
@Name("jdk.SecurityPropertyModification")
@Description("Modification of Security property")
@MirrorEvent(className = "jdk.internal.event.SecurityPropertyModificationEvent")
@RemoveFields("duration")
@StackFilter({"java.security.Security::setProperty"})
public final class SecurityPropertyModificationEvent extends AbstractJDKEvent {
public final class SecurityPropertyModificationEvent extends MirrorEvent {
@Label("Key")
public String key;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,10 +36,9 @@
@Label("Security Provider Instance Request")
@Name("jdk.SecurityProviderService")
@Description("Details of Provider.getInstance(String type, String algorithm) calls")
@MirrorEvent(className = "jdk.internal.event.SecurityProviderServiceEvent")
@RemoveFields("duration")
@StackFilter({"java.security.Provider::getService"})
public final class SecurityProviderServiceEvent extends AbstractJDKEvent {
public final class SecurityProviderServiceEvent extends MirrorEvent {
@Label("Type of Service")
public String type;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -40,9 +40,8 @@
" The checks are usually performed just once per serializable class," +
" the first time it is used by serialization." +
" Under high memory pressure, a class might be re-checked again.")
@MirrorEvent(className = "jdk.internal.event.SerializationMisdeclarationEvent")
@RemoveFields({"duration", "stackTrace", "eventThread"})
public final class SerializationMisdeclarationEvent extends AbstractJDKEvent {
public final class SerializationMisdeclarationEvent extends MirrorEvent {

@Label("Misdeclared Class")
public Class<?> misdeclaredClass;
Expand Down
5 changes: 2 additions & 3 deletions src/jdk.jfr/share/classes/jdk/jfr/events/SocketReadEvent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -38,8 +38,7 @@
@Label("Socket Read")
@Category("Java Application")
@Description("Reading data from a socket")
@MirrorEvent(className = "jdk.internal.event.SocketReadEvent")
public final class SocketReadEvent extends AbstractJDKEvent {
public final class SocketReadEvent extends MirrorEvent {

@Label("Remote Host")
public String host;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,8 +37,7 @@
@Label("Socket Write")
@Category("Java Application")
@Description("Writing data to a socket")
@MirrorEvent(className = "jdk.internal.event.SocketWriteEvent")
public final class SocketWriteEvent extends AbstractJDKEvent {
public final class SocketWriteEvent extends MirrorEvent {

@Label("Remote Host")
public String host;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -37,10 +37,9 @@
@Label("TLS Handshake")
@Name("jdk.TLSHandshake")
@Description("Parameters used in TLS Handshake")
@MirrorEvent(className = "jdk.internal.event.TLSHandshakeEvent")
@RemoveFields("duration")
@StackFilter("sun.security.ssl.Finished::recordEvent")
public final class TLSHandshakeEvent extends AbstractJDKEvent {
public final class TLSHandshakeEvent extends MirrorEvent {
@Label("Peer Host")
public String peerHost;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,11 +34,10 @@
@Category("Java Application")
@Label("Java Thread Sleep")
@Name("jdk.ThreadSleep")
@MirrorEvent(className = "jdk.internal.event.ThreadSleepEvent")
@StackFilter({"java.lang.Thread::afterSleep",
"java.lang.Thread::sleepNanos",
"java.lang.Thread::sleep"})
public final class ThreadSleepEvent extends AbstractJDKEvent {
public final class ThreadSleepEvent extends MirrorEvent {
@Label("Sleep Time")
@Timespan(Timespan.NANOSECONDS)
public long time;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,9 +34,8 @@
@Category("Java Application")
@Label("Virtual Thread End")
@Name("jdk.VirtualThreadEnd")
@MirrorEvent(className = "jdk.internal.event.VirtualThreadEndEvent")
@RemoveFields({"duration", "stackTrace"})
public final class VirtualThreadEndEvent extends AbstractJDKEvent {
public final class VirtualThreadEndEvent extends MirrorEvent {

@Label("Thread Id")
public long javaThreadId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,6 +33,5 @@
@Category("Java Application")
@Label("Virtual Thread Pinned")
@Name("jdk.VirtualThreadPinned")
@MirrorEvent(className = "jdk.internal.event.VirtualThreadPinnedEvent")
public final class VirtualThreadPinnedEvent extends AbstractJDKEvent {
public final class VirtualThreadPinnedEvent extends MirrorEvent {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,9 +34,8 @@
@Category("Java Application")
@Label("Virtual Thread Start")
@Name("jdk.VirtualThreadStart")
@MirrorEvent(className = "jdk.internal.event.VirtualThreadStartEvent")
@RemoveFields("duration")
public final class VirtualThreadStartEvent extends AbstractJDKEvent {
public final class VirtualThreadStartEvent extends MirrorEvent {

@Label("Thread Id")
public long javaThreadId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,9 +36,8 @@
@Label("Virtual Thread Submit Failed")
@Name("jdk.VirtualThreadSubmitFailed")
@Description("Submit of task for virtual thread failed")
@MirrorEvent(className = "jdk.internal.event.VirtualThreadSubmitFailedEvent")
@RemoveFields("duration")
public final class VirtualThreadSubmitFailedEvent extends AbstractJDKEvent {
public final class VirtualThreadSubmitFailedEvent extends MirrorEvent {

@Label("Thread Id")
public long javaThreadId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,9 +33,8 @@
@Label("X509 Certificate")
@Name("jdk.X509Certificate")
@Description("Details of X.509 Certificate parsed by JDK")
@MirrorEvent(className = "jdk.internal.event.X509CertificateEvent")
@RemoveFields("duration")
public final class X509CertificateEvent extends AbstractJDKEvent {
public final class X509CertificateEvent extends MirrorEvent {
@Label("Signature Algorithm")
public String algorithm;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,9 +33,8 @@
@Label("X509 Validation")
@Name("jdk.X509Validation")
@Description("Serial numbers from X.509 Certificates forming chain of trust")
@MirrorEvent(className = "jdk.internal.event.X509ValidationEvent")
@RemoveFields("duration")
public final class X509ValidationEvent extends AbstractJDKEvent {
public final class X509ValidationEvent extends MirrorEvent {
@CertificateId
@Label("Certificate Id")
@Unsigned
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -90,7 +90,6 @@ private record SettingDesc(ClassDesc paramType, String methodName) {
private static final ClassDesc TYPE_ISE = Bytecode.classDesc(IllegalStateException.class);
private static final ClassDesc TYPE_EVENT_WRITER = classDesc(EventWriter.class);
private static final ClassDesc TYPE_EVENT_WRITER_FACTORY = ClassDesc.of("jdk.jfr.internal.event.EventWriterFactory");
private static final ClassDesc TYPE_MIRROR_EVENT = Bytecode.classDesc(MirrorEvent.class);
private static final ClassDesc TYPE_OBJECT = Bytecode.classDesc(Object.class);
private static final ClassDesc TYPE_SETTING_DEFINITION = Bytecode.classDesc(SettingDefinition.class);
private static final MethodDesc METHOD_BEGIN = MethodDesc.of("begin", "()V");
Expand Down Expand Up @@ -144,9 +143,7 @@ private record SettingDesc(ClassDesc paramType, String methodName) {

private ImplicitFields determineImplicitFields() {
if (isJDK) {
// For now, only support mirror events in java.base
String fullName = "java.base:" + className;
Class<?> eventClass = MirrorEvents.find(fullName);
Class<?> eventClass = MirrorEvents.find(isJDK, className);
if (eventClass != null) {
return new ImplicitFields(eventClass);
}
Expand Down Expand Up @@ -221,20 +218,6 @@ boolean isEnabled() {
return true;
}

boolean isMirrorEvent() {
String typeDescriptor = TYPE_MIRROR_EVENT.descriptorString();
for (ClassElement ce : classModel.elements()) {
if (ce instanceof RuntimeVisibleAnnotationsAttribute rvaa) {
for (var annotation : rvaa.annotations()) {
if (annotation.className().equalsString(typeDescriptor)) {
return true;
}
}
}
}
return false;
}

@SuppressWarnings("unchecked")
// Only supports String, String[] and Boolean values
private static <T> T annotationValue(ClassModel classModel, ClassDesc classDesc, Class<T> type) {
Expand Down
5 changes: 1 addition & 4 deletions src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -112,9 +112,6 @@ static byte[] bytesForEagerInstrumentation(long traceId, boolean forceInstrument
Logger.log(LogTag.JFR_SYSTEM, LogLevel.INFO, "Skipping instrumentation for " + eventName + " since container support is missing");
return oldBytes;
}
if (ei.isMirrorEvent()) {
return oldBytes;
}

if (!forceInstrumentation) {
// Assume we are recording
Expand Down
Loading