Simplify ftrace architecture and integration with traced_probes
Historically the ftrace reader code has been strongly decoupled
from the rest of the codebase. The use case that was justifying
it (fall back into a library for other perf tools) is no more,
and we are left with extra layers that are unneeded and hurt
code readability. This CL removes the glue layers between
ftrace and probes_producer, in preparation of upcoming behavioral
changes (Flush). The main changes introduced by this CL are:
- Introduce a base class with hand-rolled RTTI for probes_producer.
This simplifies the bookkeeping logic within the traced_probes
binary.
- Collapse Ftrace's Sink and SinkDelegate into a FtraceDataSource
class. FDS keeps track of all the state of ftrace for a given
tracing session.
- Remove ftrace/end_to_end_integrationtest.cc, it had just two
tests and they were disabled.
- Minor cleanups: introduce PERFETTO_WARN_UNUSED_RESULT; move
stats to a dedicated header.
Change-Id: I7047fc07bbaf9f9bf862cdb81c87e567ffbc6779
diff --git a/Android.bp b/Android.bp
index 0cd32cc..cf7502e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -70,11 +70,13 @@
"src/traced/probes/ftrace/ftrace_config.cc",
"src/traced/probes/ftrace/ftrace_config_muxer.cc",
"src/traced/probes/ftrace/ftrace_controller.cc",
+ "src/traced/probes/ftrace/ftrace_data_source.cc",
"src/traced/probes/ftrace/ftrace_metadata.cc",
"src/traced/probes/ftrace/ftrace_procfs.cc",
- "src/traced/probes/ftrace/ftrace_sink.cc",
+ "src/traced/probes/ftrace/ftrace_stats.cc",
"src/traced/probes/ftrace/proto_translation_table.cc",
"src/traced/probes/probes.cc",
+ "src/traced/probes/probes_data_source.cc",
"src/traced/probes/probes_producer.cc",
"src/traced/probes/ps/process_stats_data_source.cc",
"src/traced/service/service.cc",
@@ -320,19 +322,20 @@
"src/traced/probes/ftrace/atrace_wrapper.cc",
"src/traced/probes/ftrace/cpu_reader.cc",
"src/traced/probes/ftrace/cpu_stats_parser.cc",
- "src/traced/probes/ftrace/end_to_end_integrationtest.cc",
"src/traced/probes/ftrace/event_info.cc",
"src/traced/probes/ftrace/event_info_constants.cc",
"src/traced/probes/ftrace/format_parser.cc",
"src/traced/probes/ftrace/ftrace_config.cc",
"src/traced/probes/ftrace/ftrace_config_muxer.cc",
"src/traced/probes/ftrace/ftrace_controller.cc",
+ "src/traced/probes/ftrace/ftrace_data_source.cc",
"src/traced/probes/ftrace/ftrace_metadata.cc",
"src/traced/probes/ftrace/ftrace_procfs.cc",
"src/traced/probes/ftrace/ftrace_procfs_integrationtest.cc",
- "src/traced/probes/ftrace/ftrace_sink.cc",
+ "src/traced/probes/ftrace/ftrace_stats.cc",
"src/traced/probes/ftrace/proto_translation_table.cc",
"src/traced/probes/ftrace/test/cpu_reader_support.cc",
+ "src/traced/probes/probes_data_source.cc",
"src/traced/probes/probes_producer.cc",
"src/traced/probes/ps/process_stats_data_source.cc",
"src/tracing/core/chrome_config.cc",
@@ -3729,13 +3732,15 @@
"src/traced/probes/ftrace/ftrace_config_unittest.cc",
"src/traced/probes/ftrace/ftrace_controller.cc",
"src/traced/probes/ftrace/ftrace_controller_unittest.cc",
+ "src/traced/probes/ftrace/ftrace_data_source.cc",
"src/traced/probes/ftrace/ftrace_metadata.cc",
"src/traced/probes/ftrace/ftrace_procfs.cc",
"src/traced/probes/ftrace/ftrace_procfs_unittest.cc",
- "src/traced/probes/ftrace/ftrace_sink.cc",
+ "src/traced/probes/ftrace/ftrace_stats.cc",
"src/traced/probes/ftrace/proto_translation_table.cc",
"src/traced/probes/ftrace/proto_translation_table_unittest.cc",
"src/traced/probes/ftrace/test/cpu_reader_support.cc",
+ "src/traced/probes/probes_data_source.cc",
"src/traced/probes/probes_producer.cc",
"src/traced/probes/ps/process_stats_data_source.cc",
"src/traced/probes/ps/process_stats_data_source_unittest.cc",