traced_perf: process sharding (choosing random processes for callstacks)
The config will specify N shards for one or more data sources, we need
to choose a random value [0,N) to use as the shard for all those data
sources. We know which sources share a session (i.e. a config) via
tracing_session_id as supplied by traced.
Instead of introducing session-scoped data and linking that to the
lifetime of data sources, I've opted to simply replicate this state in
each DataSourceState. The extra plumbing through EventConfig::Create is
a bit clumsy, but ultimately TargetFilter is a logical place to host
this state.
Doc: go/tperf-sharding
Bug: 223773242
Change-Id: I84982c819ef541735bf3c6821c30efed2122ae94
diff --git a/Android.bp b/Android.bp
index 71b26e4..335b330 100644
--- a/Android.bp
+++ b/Android.bp
@@ -8278,6 +8278,7 @@
name: "perfetto_src_profiling_perf_producer_unittests",
srcs: [
"src/profiling/perf/event_config_unittest.cc",
+ "src/profiling/perf/perf_producer_unittest.cc",
"src/profiling/perf/unwind_queue_unittest.cc",
],
}