Trace Redaction - Create shared filter ftrace events primitive
There are multiple primitives that filter conditional drop ftrace
events. When these are individual primitives, each packet is
deserialized and reserialized N times (where N is the number of
filter primitives).
To reduce the number of reserializations to 1, this CL introduces
a primitive that accepts filters. Each event is tested against
the filters and if any filter say "drop event", the event is
dropped and all later filters are skipped.
Bug: 332547909
Change-Id: I6c9cb665863aafd67d42adc84e3a0fb474d953da
diff --git a/Android.bp b/Android.bp
index 3832040..0e56824 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12848,6 +12848,8 @@
name: "perfetto_src_trace_redaction_trace_redaction",
srcs: [
"src/trace_redaction/build_timeline.cc",
+ "src/trace_redaction/filter_ftrace_using_allowlist.cc",
+ "src/trace_redaction/filter_sched_waking_events.cc",
"src/trace_redaction/find_package_uid.cc",
"src/trace_redaction/optimize_timeline.cc",
"src/trace_redaction/populate_allow_lists.cc",
@@ -12855,7 +12857,6 @@
"src/trace_redaction/proto_util.cc",
"src/trace_redaction/prune_package_list.cc",
"src/trace_redaction/redact_sched_switch.cc",
- "src/trace_redaction/redact_sched_waking.cc",
"src/trace_redaction/scrub_ftrace_events.cc",
"src/trace_redaction/scrub_process_trees.cc",
"src/trace_redaction/scrub_task_rename.cc",
@@ -12870,13 +12871,13 @@
name: "perfetto_src_trace_redaction_unittests",
srcs: [
"src/trace_redaction/build_timeline_unittest.cc",
+ "src/trace_redaction/filter_ftrace_using_allowlist_unittest.cc",
+ "src/trace_redaction/filter_sched_waking_events_unittest.cc",
"src/trace_redaction/find_package_uid_unittest.cc",
"src/trace_redaction/process_thread_timeline_unittest.cc",
"src/trace_redaction/proto_util_unittest.cc",
"src/trace_redaction/prune_package_list_unittest.cc",
"src/trace_redaction/redact_sched_switch_unittest.cc",
- "src/trace_redaction/redact_sched_waking_unittest.cc",
- "src/trace_redaction/scrub_ftrace_events_unittest.cc",
"src/trace_redaction/scrub_task_rename_unittest.cc",
"src/trace_redaction/scrub_trace_packet_unittest.cc",
],