Fold perfetto_src_tracing_ipc into libperfetto_client
Until now tracing:ipc was a static library and was depended on by
a bunch of android.bp targets (mainly CTS tests and, recently, surfaceflinger).
The newly introduced libperfetto_client_experimental should have linked in
also the tracing:ipc target, but accidentally it didn't.
This CL is fixing this, by making tracing:ipc a source set and by making the
CTS targets depend on the superset libperfetto_client.
Sadly, however, surfaceflinger ended up depending on both libperfetto_client
and tracing_ipc. We can't easily remove tracing_ipc because doing so would
require multi-repo atomic changes. Instead this CL leaves an empty
tracing_ipc target, to keep surfaceflinger building. The target will be removed
as soon as surfaceflinger drops the dependency and depends only on
libperfetto_client.
Bug: 140591279
Change-Id: If558bcd18b0987ec3043b7d05e6761aed3e2ecda
diff --git a/Android.bp b/Android.bp
index bd64765..36c42b6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -156,6 +156,13 @@
"src/tracing/core/tracing_service_impl.cc",
"src/tracing/core/tracing_service_state.cc",
"src/tracing/core/virtual_destructors.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/trace_writer_base.cc",
],
shared_libs: [
@@ -165,9 +172,6 @@
"libprotobuf-cpp-lite",
"libunwindstack",
],
- static_libs: [
- "perfetto_src_tracing_ipc",
- ],
init_rc: [
"heapprofd.rc",
],
@@ -402,15 +406,19 @@
"src/tracing/core/tracing_service_impl.cc",
"src/tracing/core/tracing_service_state.cc",
"src/tracing/core/virtual_destructors.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/trace_writer_base.cc",
],
shared_libs: [
"liblog",
"libprotobuf-cpp-lite",
],
- static_libs: [
- "perfetto_src_tracing_ipc",
- ],
export_include_dirs: [
"include",
"include/perfetto/base/build_configs/android_tree",
@@ -602,6 +610,13 @@
"src/tracing/internal/in_process_tracing_backend.cc",
"src/tracing/internal/system_tracing_backend.cc",
"src/tracing/internal/tracing_muxer_impl.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/platform.cc",
"src/tracing/platform_posix.cc",
"src/tracing/trace_writer_base.cc",
@@ -612,9 +627,6 @@
shared_libs: [
"libprotobuf-cpp-lite",
],
- static_libs: [
- "perfetto_src_tracing_ipc",
- ],
export_include_dirs: [
"include",
"include/perfetto/base/build_configs/android_tree",
@@ -813,6 +825,13 @@
"src/tracing/core/tracing_service_impl.cc",
"src/tracing/core/tracing_service_state.cc",
"src/tracing/core/virtual_destructors.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/trace_writer_base.cc",
],
shared_libs: [
@@ -820,9 +839,6 @@
"libprotobuf-cpp-lite",
"libz",
],
- static_libs: [
- "perfetto_src_tracing_ipc",
- ],
generated_headers: [
"perfetto_protos_perfetto_common_lite_gen_headers",
"perfetto_protos_perfetto_common_zero_gen_headers",
@@ -1066,6 +1082,13 @@
"src/tracing/internal/in_process_tracing_backend.cc",
"src/tracing/internal/system_tracing_backend.cc",
"src/tracing/internal/tracing_muxer_impl.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/platform.cc",
"src/tracing/platform_posix.cc",
"src/tracing/test/api_test_support.cc",
@@ -1089,7 +1112,6 @@
static_libs: [
"libgmock",
"libperfetto_client_experimental",
- "perfetto_src_tracing_ipc",
],
generated_headers: [
"perfetto_protos_perfetto_common_lite_gen_headers",
@@ -3947,206 +3969,6 @@
],
}
-// GN target: //src/tracing:ipc
-cc_library_static {
- name: "perfetto_src_tracing_ipc",
- srcs: [
- ":perfetto_protos_perfetto_common_lite_gen",
- ":perfetto_protos_perfetto_common_zero_gen",
- ":perfetto_protos_perfetto_config_android_lite_gen",
- ":perfetto_protos_perfetto_config_android_zero_gen",
- ":perfetto_protos_perfetto_config_ftrace_lite_gen",
- ":perfetto_protos_perfetto_config_ftrace_zero_gen",
- ":perfetto_protos_perfetto_config_gpu_lite_gen",
- ":perfetto_protos_perfetto_config_gpu_zero_gen",
- ":perfetto_protos_perfetto_config_inode_file_lite_gen",
- ":perfetto_protos_perfetto_config_inode_file_zero_gen",
- ":perfetto_protos_perfetto_config_lite_gen",
- ":perfetto_protos_perfetto_config_power_lite_gen",
- ":perfetto_protos_perfetto_config_power_zero_gen",
- ":perfetto_protos_perfetto_config_process_stats_lite_gen",
- ":perfetto_protos_perfetto_config_process_stats_zero_gen",
- ":perfetto_protos_perfetto_config_profiling_lite_gen",
- ":perfetto_protos_perfetto_config_profiling_zero_gen",
- ":perfetto_protos_perfetto_config_sys_stats_lite_gen",
- ":perfetto_protos_perfetto_config_sys_stats_zero_gen",
- ":perfetto_protos_perfetto_config_zero_gen",
- ":perfetto_protos_perfetto_ipc_ipc_gen",
- ":perfetto_protos_perfetto_trace_android_zero_gen",
- ":perfetto_protos_perfetto_trace_chrome_zero_gen",
- ":perfetto_protos_perfetto_trace_filesystem_zero_gen",
- ":perfetto_protos_perfetto_trace_ftrace_zero_gen",
- ":perfetto_protos_perfetto_trace_gpu_zero_gen",
- ":perfetto_protos_perfetto_trace_interned_data_zero_gen",
- ":perfetto_protos_perfetto_trace_minimal_lite_gen",
- ":perfetto_protos_perfetto_trace_minimal_zero_gen",
- ":perfetto_protos_perfetto_trace_non_minimal_zero_gen",
- ":perfetto_protos_perfetto_trace_perfetto_zero_gen",
- ":perfetto_protos_perfetto_trace_power_zero_gen",
- ":perfetto_protos_perfetto_trace_profiling_zero_gen",
- ":perfetto_protos_perfetto_trace_ps_zero_gen",
- ":perfetto_protos_perfetto_trace_sys_stats_zero_gen",
- ":perfetto_protos_perfetto_trace_track_event_zero_gen",
- ":perfetto_protos_perfetto_trace_trusted_lite_gen",
- ":perfetto_src_ipc_wire_protocol_gen",
- "src/base/event_fd.cc",
- "src/base/file_utils.cc",
- "src/base/metatrace.cc",
- "src/base/paged_memory.cc",
- "src/base/pipe.cc",
- "src/base/string_splitter.cc",
- "src/base/string_utils.cc",
- "src/base/string_view.cc",
- "src/base/temp_file.cc",
- "src/base/thread_checker.cc",
- "src/base/thread_task_runner.cc",
- "src/base/time.cc",
- "src/base/unix_socket.cc",
- "src/base/unix_task_runner.cc",
- "src/base/uuid.cc",
- "src/base/virtual_destructors.cc",
- "src/base/waitable_event.cc",
- "src/base/watchdog_posix.cc",
- "src/ipc/buffered_frame_deserializer.cc",
- "src/ipc/client_impl.cc",
- "src/ipc/deferred.cc",
- "src/ipc/host_impl.cc",
- "src/ipc/service_proxy.cc",
- "src/ipc/virtual_destructors.cc",
- "src/protozero/message.cc",
- "src/protozero/message_handle.cc",
- "src/protozero/proto_decoder.cc",
- "src/protozero/scattered_heap_buffer.cc",
- "src/protozero/scattered_stream_null_delegate.cc",
- "src/protozero/scattered_stream_writer.cc",
- "src/tracing/core/chrome_config.cc",
- "src/tracing/core/commit_data_request.cc",
- "src/tracing/core/data_source_config.cc",
- "src/tracing/core/data_source_descriptor.cc",
- "src/tracing/core/id_allocator.cc",
- "src/tracing/core/metatrace_writer.cc",
- "src/tracing/core/null_trace_writer.cc",
- "src/tracing/core/observable_events.cc",
- "src/tracing/core/packet_stream_validator.cc",
- "src/tracing/core/shared_memory_abi.cc",
- "src/tracing/core/shared_memory_arbiter_impl.cc",
- "src/tracing/core/sliced_protobuf_input_stream.cc",
- "src/tracing/core/startup_trace_writer.cc",
- "src/tracing/core/startup_trace_writer_registry.cc",
- "src/tracing/core/test_config.cc",
- "src/tracing/core/trace_buffer.cc",
- "src/tracing/core/trace_config.cc",
- "src/tracing/core/trace_packet.cc",
- "src/tracing/core/trace_stats.cc",
- "src/tracing/core/trace_writer_impl.cc",
- "src/tracing/core/tracing_service_impl.cc",
- "src/tracing/core/tracing_service_state.cc",
- "src/tracing/core/virtual_destructors.cc",
- "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
- "src/tracing/ipc/default_socket.cc",
- "src/tracing/ipc/posix_shared_memory.cc",
- "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
- "src/tracing/ipc/service/consumer_ipc_service.cc",
- "src/tracing/ipc/service/producer_ipc_service.cc",
- "src/tracing/ipc/service/service_ipc_host_impl.cc",
- "src/tracing/trace_writer_base.cc",
- ],
- shared_libs: [
- "libprotobuf-cpp-lite",
- ],
- export_include_dirs: [
- "include",
- "include/perfetto/base/build_configs/android_tree",
- ],
- generated_headers: [
- "perfetto_protos_perfetto_common_lite_gen_headers",
- "perfetto_protos_perfetto_common_zero_gen_headers",
- "perfetto_protos_perfetto_config_android_lite_gen_headers",
- "perfetto_protos_perfetto_config_android_zero_gen_headers",
- "perfetto_protos_perfetto_config_ftrace_lite_gen_headers",
- "perfetto_protos_perfetto_config_ftrace_zero_gen_headers",
- "perfetto_protos_perfetto_config_gpu_lite_gen_headers",
- "perfetto_protos_perfetto_config_gpu_zero_gen_headers",
- "perfetto_protos_perfetto_config_inode_file_lite_gen_headers",
- "perfetto_protos_perfetto_config_inode_file_zero_gen_headers",
- "perfetto_protos_perfetto_config_lite_gen_headers",
- "perfetto_protos_perfetto_config_power_lite_gen_headers",
- "perfetto_protos_perfetto_config_power_zero_gen_headers",
- "perfetto_protos_perfetto_config_process_stats_lite_gen_headers",
- "perfetto_protos_perfetto_config_process_stats_zero_gen_headers",
- "perfetto_protos_perfetto_config_profiling_lite_gen_headers",
- "perfetto_protos_perfetto_config_profiling_zero_gen_headers",
- "perfetto_protos_perfetto_config_sys_stats_lite_gen_headers",
- "perfetto_protos_perfetto_config_sys_stats_zero_gen_headers",
- "perfetto_protos_perfetto_config_zero_gen_headers",
- "perfetto_protos_perfetto_ipc_ipc_gen_headers",
- "perfetto_protos_perfetto_trace_android_zero_gen_headers",
- "perfetto_protos_perfetto_trace_chrome_zero_gen_headers",
- "perfetto_protos_perfetto_trace_filesystem_zero_gen_headers",
- "perfetto_protos_perfetto_trace_ftrace_zero_gen_headers",
- "perfetto_protos_perfetto_trace_gpu_zero_gen_headers",
- "perfetto_protos_perfetto_trace_interned_data_zero_gen_headers",
- "perfetto_protos_perfetto_trace_minimal_lite_gen_headers",
- "perfetto_protos_perfetto_trace_minimal_zero_gen_headers",
- "perfetto_protos_perfetto_trace_non_minimal_zero_gen_headers",
- "perfetto_protos_perfetto_trace_perfetto_zero_gen_headers",
- "perfetto_protos_perfetto_trace_power_zero_gen_headers",
- "perfetto_protos_perfetto_trace_profiling_zero_gen_headers",
- "perfetto_protos_perfetto_trace_ps_zero_gen_headers",
- "perfetto_protos_perfetto_trace_sys_stats_zero_gen_headers",
- "perfetto_protos_perfetto_trace_track_event_zero_gen_headers",
- "perfetto_protos_perfetto_trace_trusted_lite_gen_headers",
- "perfetto_src_ipc_wire_protocol_gen_headers",
- ],
- export_generated_headers: [
- "perfetto_protos_perfetto_common_lite_gen_headers",
- "perfetto_protos_perfetto_common_zero_gen_headers",
- "perfetto_protos_perfetto_config_android_lite_gen_headers",
- "perfetto_protos_perfetto_config_android_zero_gen_headers",
- "perfetto_protos_perfetto_config_ftrace_lite_gen_headers",
- "perfetto_protos_perfetto_config_ftrace_zero_gen_headers",
- "perfetto_protos_perfetto_config_gpu_lite_gen_headers",
- "perfetto_protos_perfetto_config_gpu_zero_gen_headers",
- "perfetto_protos_perfetto_config_inode_file_lite_gen_headers",
- "perfetto_protos_perfetto_config_inode_file_zero_gen_headers",
- "perfetto_protos_perfetto_config_lite_gen_headers",
- "perfetto_protos_perfetto_config_power_lite_gen_headers",
- "perfetto_protos_perfetto_config_power_zero_gen_headers",
- "perfetto_protos_perfetto_config_process_stats_lite_gen_headers",
- "perfetto_protos_perfetto_config_process_stats_zero_gen_headers",
- "perfetto_protos_perfetto_config_profiling_lite_gen_headers",
- "perfetto_protos_perfetto_config_profiling_zero_gen_headers",
- "perfetto_protos_perfetto_config_sys_stats_lite_gen_headers",
- "perfetto_protos_perfetto_config_sys_stats_zero_gen_headers",
- "perfetto_protos_perfetto_config_zero_gen_headers",
- "perfetto_protos_perfetto_ipc_ipc_gen_headers",
- "perfetto_protos_perfetto_trace_android_zero_gen_headers",
- "perfetto_protos_perfetto_trace_chrome_zero_gen_headers",
- "perfetto_protos_perfetto_trace_filesystem_zero_gen_headers",
- "perfetto_protos_perfetto_trace_ftrace_zero_gen_headers",
- "perfetto_protos_perfetto_trace_gpu_zero_gen_headers",
- "perfetto_protos_perfetto_trace_interned_data_zero_gen_headers",
- "perfetto_protos_perfetto_trace_minimal_lite_gen_headers",
- "perfetto_protos_perfetto_trace_minimal_zero_gen_headers",
- "perfetto_protos_perfetto_trace_non_minimal_zero_gen_headers",
- "perfetto_protos_perfetto_trace_perfetto_zero_gen_headers",
- "perfetto_protos_perfetto_trace_power_zero_gen_headers",
- "perfetto_protos_perfetto_trace_profiling_zero_gen_headers",
- "perfetto_protos_perfetto_trace_ps_zero_gen_headers",
- "perfetto_protos_perfetto_trace_sys_stats_zero_gen_headers",
- "perfetto_protos_perfetto_trace_track_event_zero_gen_headers",
- "perfetto_protos_perfetto_trace_trusted_lite_gen_headers",
- "perfetto_src_ipc_wire_protocol_gen_headers",
- ],
- defaults: [
- "perfetto_defaults",
- ],
- cflags: [
- "-DGOOGLE_PROTOBUF_NO_RTTI",
- "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
- ],
-}
-
// GN target: //protos/perfetto/trace:perfetto_trace_protos
cc_library_static {
name: "perfetto_trace_protos",
@@ -4593,7 +4415,14 @@
"src/tracing/core/tracing_service_impl_unittest.cc",
"src/tracing/core/tracing_service_state.cc",
"src/tracing/core/virtual_destructors.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
"src/tracing/ipc/posix_shared_memory_unittest.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/test/aligned_buffer_test.cc",
"src/tracing/test/fake_packet.cc",
"src/tracing/test/mock_consumer.cc",
@@ -4618,7 +4447,6 @@
],
static_libs: [
"libgmock",
- "perfetto_src_tracing_ipc",
],
generated_headers: [
"gen_merged_sql_metrics",
@@ -5258,15 +5086,19 @@
"src/tracing/core/tracing_service_impl.cc",
"src/tracing/core/tracing_service_state.cc",
"src/tracing/core/virtual_destructors.cc",
+ "src/tracing/ipc/consumer/consumer_ipc_client_impl.cc",
+ "src/tracing/ipc/default_socket.cc",
+ "src/tracing/ipc/posix_shared_memory.cc",
+ "src/tracing/ipc/producer/producer_ipc_client_impl.cc",
+ "src/tracing/ipc/service/consumer_ipc_service.cc",
+ "src/tracing/ipc/service/producer_ipc_service.cc",
+ "src/tracing/ipc/service/service_ipc_host_impl.cc",
"src/tracing/trace_writer_base.cc",
],
shared_libs: [
"liblog",
"libprotobuf-cpp-lite",
],
- static_libs: [
- "perfetto_src_tracing_ipc",
- ],
generated_headers: [
"perfetto_protos_perfetto_common_lite_gen_headers",
"perfetto_protos_perfetto_common_zero_gen_headers",
@@ -5318,6 +5150,7 @@
}
// These targets are appended to the autogenerated Android.bp by tools/gen_android_bp.
+
cc_library_static {
name: "perfetto_cts_deps",
srcs: [
@@ -5341,7 +5174,7 @@
static_libs: [
"libgmock",
"libgtest",
- "perfetto_src_tracing_ipc",
+ "libperfetto_client_experimental",
"perfetto_trace_protos",
],
defaults: [
@@ -5361,7 +5194,7 @@
],
static_libs: [
"libgtest",
- "perfetto_src_tracing_ipc",
+ "libperfetto_client_experimental",
],
defaults: [
"perfetto_defaults",
@@ -5387,7 +5220,6 @@
],
static_libs: [
"libperfetto_client_experimental",
- "perfetto_src_tracing_ipc",
"perfetto_trace_protos",
],
shared_libs: [
@@ -5401,4 +5233,18 @@
defaults: [
"perfetto_defaults",
],
+}
+
+// TODO(primiano): remove this target after the dep from
+// frameworks/native/services/surfaceflinger/Android.bp goes away. This has been
+// introduced only to avoid multi-repo atomic CLs.
+
+cc_library_static {
+ name: "perfetto_src_tracing_ipc",
+ srcs: [
+ "src/android_internal/empty_file.cc",
+ ],
+ defaults: [
+ "perfetto_defaults",
+ ],
}
\ No newline at end of file