Reviewed on: 2022-02-14
The debug_data components collect debug data output by test components via the fuchsia.debugdata.Publisher
protocols. This protocol is most commonly used in tests to output profiling information that is used to produce coverage data. Currently, debug_data components also merge together profiles produced for reporting coverage, which reduces the size of profiles pulled off device.
The debug_data components are delivered in the same package as test_manager
, and should be considered an implementation detail of test_manager
.
Currently, there are two debug_data components:
fuchsia.test.internal.DebugDataController
protocol, which allows the caller to specify which realms to collect debug data for, and provides a synchronization signal that indicates when processing is complete.The debug_data component exposes the fuchsia.test.internal.DebugDataController
protocol, which adds the concept of a Set. A Set is a group of test realms for which to collect debug data. Sets provide isolation. For example, when two test runs are occurring at the same time, collecting debug data in two separate sets ensures that each run will see isolated results.
test_manager
creates a new Set for each test run, and reports the realms that will run within the test run to debug_data. debug_data in turn signals back if any debug data was processed for the Set, and signals when all processing for the Set is complete.
The debug_data component understands when it has completed processing all debug data for a realm by inspecting a stream of component lifecycle events, and determining when each realm has been destroyed (and therefore can produce no further debug data).
Unit tests can be run with
$ fx test debug-data-rust-unittests
The entry point for debug_data is in src/main.rs
.