simpleperf: Refactor RecordFilter to check each field separately
RecordFilter filters samples based on a sample's fields. The current
implementation splits the check into include and exclude conditions.
The include conditions use OR operations. For example, if we use
`--include-pid 1 --include-tid 2`, then a sample passes the filter
by either having pid == 1 or tid == 2.
It has below problems:
1) It may be counter intuitive. Users probably expect an include
filter to remove all samples not matching the filter, which needs
AND operations between include filters.
2) It conflicts with the help messages for filter options in scripts,
which say AND operations are used.
3) It may confuse users about which operations are used when adding
new filters.
4) It's probably overdesigned. I don't know any real need of it.
So refactor RecordFilter to check each field separately. A sample
must match all filters to pass the check. Also use separate classes
for filters to make them easier to extend.
Bug: 307610053
Test: run simpleperf_unit_test
Change-Id: I582f6fc0914ec194030e96766690f7a88917efec
8 files changed