RFR: 8256156: JFR: Allow 'jfr' tool to show metadata without a recording [v12]

Yi Yang github.com+5010047+kelthuzadx at openjdk.java.net
Fri Mar 5 07:15:06 UTC 2021


On Tue, 2 Mar 2021 04:25:45 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix
>
> test/jdk/jdk/jfr/tool/TestMetadata.java line 123:
> 
>> 121: 
>> 122:     static void testWildcardAndAcronym() throws Throwable {
>> 123:         OutputAnalyzer output = ExecuteHelper.jfr("metadata", "--events", "Thread*");
> 
> Instead of depending on name of existing JVM events (which may change, be removed or interfere with wildcard expansion done by the OS) it would be better to create two custom Java events with an unlikely name pattern, i.e. com.example.XXZQZYY and com.stuff.ZQZPP, and then filter on "ZQZ".  
> 
> To make sure they are registered, you can do:
> 
>     FlightRecorder.register(XXZQZYY.class); 
>     FlightRecorder.register(ZQZPP.class); 
> 
> in static initializer so it is executed before calling ExecuteHelper.jfr("metadata", "--events", "ZQZ*");

Make sense, I re-implement the test, using customized events.

> test/jdk/jdk/jfr/tool/TestMetadata.java line 122:
> 
>> 120:     }
>> 121: 
>> 122:     static void testWildcardAndAcronym() throws Throwable {
> 
> The name of the seems misleading since it doesn't test acronyms, testWildcard() shuld be sufficient.

`MyEv*` and `Custo*` are expected to acronym filter, so I keep this name, please let me know if I did wrong.

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

PR: https://git.openjdk.java.net/jdk/pull/1904


More information about the hotspot-jfr-dev mailing list