traced_perf: basic producer scaffolding with logging of samples on Flush.
Nothing final about the class structure / control flow yet, will keep iterating
in future patches. Next step is handling registers, and doing proper unwinding.
The build targets are split up in preparation for later sharing a .so with
heapprofd (similar to traced and traced_probes).
Bug: 144281346
Change-Id: I1addfc5c8c559fe67283e1241b19ac66077b6cf0
diff --git a/gn/perfetto.gni b/gn/perfetto.gni
index 4dbcd42..42f0cc5 100644
--- a/gn/perfetto.gni
+++ b/gn/perfetto.gni
@@ -147,6 +147,11 @@
(perfetto_build_standalone && is_clang &&
(is_linux || (is_android && android_api_level >= 26)))
+ # Build the perf event profiler (traced_perf).
+ # TODO(b/144281346): under development.
+ enable_perfetto_traced_perf =
+ perfetto_build_standalone && (is_linux || is_android)
+
# The Trace Processor: offline analytical engine to process traces and compute
# metrics using a SQL engine.
enable_perfetto_trace_processor =
diff --git a/gn/perfetto_unittests.gni b/gn/perfetto_unittests.gni
index bdcf82f..b8df601 100644
--- a/gn/perfetto_unittests.gni
+++ b/gn/perfetto_unittests.gni
@@ -55,6 +55,10 @@
]
}
+if (enable_perfetto_traced_perf) {
+ perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ]
+}
+
if (enable_perfetto_trace_processor) {
perfetto_unittests_targets += [ "src/trace_processor:unittests" ]