changeset 60191:207fa617f855

8239585: JFR: Native events should support empty payloads Reviewed-by: mgronlun
author egahlin
date Mon, 24 Feb 2020 17:10:01 +0100
parents d3b8307bd677
children 9374fc702a03
files make/src/classes/build/tools/jfr/GenerateJfrFiles.java src/hotspot/share/jfr/metadata/metadata.xsd
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/src/classes/build/tools/jfr/GenerateJfrFiles.java	Mon Feb 24 16:42:22 2020 +0100
+++ b/make/src/classes/build/tools/jfr/GenerateJfrFiles.java	Mon Feb 24 17:10:01 2020 +0100
@@ -636,6 +636,12 @@
             }
             out.write("  }");
         }
+
+        // Avoid clash with static commit() method
+        if (event.fields.isEmpty()) {
+            return;
+        }
+
         out.write("");
         StringJoiner sj = new StringJoiner(",\n                     ");
         if (event.startTime) {
--- a/src/hotspot/share/jfr/metadata/metadata.xsd	Mon Feb 24 16:42:22 2020 +0100
+++ b/src/hotspot/share/jfr/metadata/metadata.xsd	Mon Feb 24 17:10:01 2020 +0100
@@ -45,7 +45,7 @@
           <xs:element maxOccurs="unbounded" name="Event">
             <xs:complexType>
               <xs:sequence>
-                <xs:element maxOccurs="unbounded" name="Field">
+                <xs:element minOccurs="0" maxOccurs="unbounded" name="Field">
                   <xs:complexType>
                     <xs:attribute name="type" type="xs:NMTOKEN" use="required" />
                     <xs:attribute name="struct" type="xs:boolean" use="optional" />