aboutsummaryrefslogtreecommitdiff
path: root/include/perfetto/tracing/internal/data_source_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/perfetto/tracing/internal/data_source_internal.h')
-rw-r--r--include/perfetto/tracing/internal/data_source_internal.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/perfetto/tracing/internal/data_source_internal.h b/include/perfetto/tracing/internal/data_source_internal.h
index cb052c64d..2be191aa9 100644
--- a/include/perfetto/tracing/internal/data_source_internal.h
+++ b/include/perfetto/tracing/internal/data_source_internal.h
@@ -61,6 +61,10 @@ struct DataSourceState {
// doing extra pointr arithmetic.
bool trace_lambda_enabled = false;
+ // The overall TracingMuxerImpl instance id, which gets incremented by
+ // ResetForTesting.
+ uint32_t muxer_id_for_testing = 0;
+
// The central buffer id that all TraceWriter(s) created by this data source
// must target.
BufferId buffer_id = 0;
@@ -114,6 +118,9 @@ struct DataSourceStateStorage {
// Per-DataSource-type global state.
struct DataSourceStaticState {
+ // System-wide unique id of the data source.
+ uint64_t id = 0;
+
// Unique index of the data source, assigned at registration time.
uint32_t index = kMaxDataSources;
@@ -145,11 +152,12 @@ struct DataSourceStaticState {
// Per-DataSource-instance thread-local state.
struct DataSourceInstanceThreadLocalState {
- using IncrementalStatePointer = std::unique_ptr<void, void (*)(void*)>;
void Reset() {
trace_writer.reset();
incremental_state.reset();
+ data_source_custom_tls.reset();
+ muxer_id_for_testing = 0;
backend_id = 0;
backend_connection_id = 0;
buffer_id = 0;
@@ -159,8 +167,11 @@ struct DataSourceInstanceThreadLocalState {
}
std::unique_ptr<TraceWriterBase> trace_writer;
- IncrementalStatePointer incremental_state = {nullptr, [](void*) {}};
+ using ObjectWithDeleter = std::unique_ptr<void, void (*)(void*)>;
+ ObjectWithDeleter incremental_state = {nullptr, [](void*) {}};
+ ObjectWithDeleter data_source_custom_tls = {nullptr, [](void*) {}};
uint32_t incremental_state_generation;
+ uint32_t muxer_id_for_testing;
TracingBackendId backend_id;
uint32_t backend_connection_id;
BufferId buffer_id;