Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8295650: JFR: jfr scrub should warn if an event type doesn't exist #10779

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Filters.java
Original file line number Diff line number Diff line change
@@ -83,6 +83,9 @@ static Predicate<EventType> createEventTypeFilter(String filterText, List<EventT
}

private static boolean unknownEventType(Predicate<EventType> f, List<EventType> types) {
if (types.isEmpty()) {
return false;
}
return !types.stream().anyMatch(f);
}

4 changes: 2 additions & 2 deletions src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Metadata.java
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ public void execute(Deque<String> options) throws UserSyntaxException, UserDataE
foundEventFilter = true;
String filterStr = options.remove();
warnForWildcardExpansion("--events", filterStr);
filters.add(Filters.createEventTypeFilter(filterStr));
filters.add(Filters.createEventTypeFilter(filterStr, List.of()));
}
if (acceptFilterOption(options, "--categories")) {
if (foundCategoryFilter) {
@@ -187,7 +187,7 @@ public void execute(Deque<String> options) throws UserSyntaxException, UserDataE
foundCategoryFilter = true;
String filterStr = options.remove();
warnForWildcardExpansion("--categories", filterStr);
filters.add(Filters.createCategoryFilter(filterStr));
filters.add(Filters.createCategoryFilter(filterStr, List.of()));
}
if (optionCount == options.size()) {
// No progress made