equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
79 private static final Set<String> knownNotCoveredEvents = new HashSet<>( |
79 private static final Set<String> knownNotCoveredEvents = new HashSet<>( |
80 // DumpReason: JDK-8213918 |
80 // DumpReason: JDK-8213918 |
81 Arrays.asList("DumpReason") |
81 Arrays.asList("DumpReason") |
82 ); |
82 ); |
83 |
83 |
|
84 // Experimental events |
|
85 private static final Set<String> experimentalEvents = new HashSet<>( |
|
86 Arrays.asList( |
|
87 "Flush", "FlushStorage", "FlushStacktrace", |
|
88 "FlushStringPool", "FlushMetadata", "FlushTypeSet") |
|
89 ); |
|
90 |
84 |
91 |
85 public static void main(String[] args) throws Exception { |
92 public static void main(String[] args) throws Exception { |
86 for (EventType type : FlightRecorder.getFlightRecorder().getEventTypes()) { |
93 for (EventType type : FlightRecorder.getFlightRecorder().getEventTypes()) { |
87 if (type.getAnnotation(Experimental.class) == null) { |
94 if (type.getAnnotation(Experimental.class) == null) { |
88 jfrEventTypes.add(type.getName().replace("jdk.", "")); |
95 jfrEventTypes.add(type.getName().replace("jdk.", "")); |
135 String eventName = (String) f.get(null); |
142 String eventName = (String) f.get(null); |
136 eventName = eventName.replace(EventNames.PREFIX, ""); |
143 eventName = eventName.replace(EventNames.PREFIX, ""); |
137 eventsFromEventNamesClass.add(eventName); |
144 eventsFromEventNamesClass.add(eventName); |
138 } |
145 } |
139 } |
146 } |
|
147 |
|
148 // remove experimental events from eventsFromEventNamesClass since jfrEventTypes |
|
149 // excludes experimental events |
|
150 eventsFromEventNamesClass.removeAll(experimentalEvents); |
140 |
151 |
141 if (!jfrEventTypes.equals(eventsFromEventNamesClass)) { |
152 if (!jfrEventTypes.equals(eventsFromEventNamesClass)) { |
142 String exceptionMsg = "Events declared in jdk.test.lib.jfr.EventNames differ " + |
153 String exceptionMsg = "Events declared in jdk.test.lib.jfr.EventNames differ " + |
143 "from events returned by FlightRecorder.getEventTypes()"; |
154 "from events returned by FlightRecorder.getEventTypes()"; |
144 print(MSG_SEPARATOR); |
155 print(MSG_SEPARATOR); |