aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parse-events.h3
-rw-r--r--parse-filter.c21
2 files changed, 24 insertions, 0 deletions
diff --git a/parse-events.h b/parse-events.h
index cc5af58..8e42947 100644
--- a/parse-events.h
+++ b/parse-events.h
@@ -586,6 +586,9 @@ int pevent_filter_add_filter_str(struct event_filter *filter,
586int pevent_filter_match(struct event_filter *filter, 586int pevent_filter_match(struct event_filter *filter,
587 struct record *record); 587 struct record *record);
588 588
589int pevent_event_filtered(struct event_filter *filter,
590 int event_id);
591
589void pevent_filter_free(struct event_filter *filter); 592void pevent_filter_free(struct event_filter *filter);
590 593
591#endif /* _PARSE_EVENTS_H */ 594#endif /* _PARSE_EVENTS_H */
diff --git a/parse-filter.c b/parse-filter.c
index d2f5c3b..98c31dd 100644
--- a/parse-filter.c
+++ b/parse-filter.c
@@ -942,6 +942,27 @@ static int test_filter(struct event_format *event,
942} 942}
943 943
944/** 944/**
945 * pevent_event_filtered - return true if event has filter
946 * @filter: filter struct with filter information
947 * @event_id: event id to test if filter exists
948 *
949 * Returns 1 if filter found for @event_id
950 * otherwise 0;
951 */
952int pevent_event_filtered(struct event_filter *filter,
953 int event_id)
954{
955 struct filter_type *filter_type;
956
957 if (!filter->filters)
958 return 0;
959
960 filter_type = find_filter_type(filter, event_id);
961
962 return filter_type ? 1 : 0;
963}
964
965/**
945 * pevent_filter_match - test if a record matches a filter 966 * pevent_filter_match - test if a record matches a filter
946 * @filter: filter struct with filter information 967 * @filter: filter struct with filter information
947 * @record: the record to test against the filter 968 * @record: the record to test against the filter