Prevent traced from blocking on a unresponsive producer.
Previously traced would block indefinitely if a producer
stop draining the IPC channel. This would result in eventually
the sendmsg call blocking and android's Watchdog killing traced
for being unresponsive, if some producer in a long trace was
unresponsive.
We add an integration test which exposed this issue to prevent
regressions, and set a timeout on the producer sockets and disconnect
the producer on timeouts.
We don't set the timeout on the consumer socket on the assumption
that the consumer is trusted and to minimize changes to our
behaviour as S is finalizing.
Bug: 169051440
Change-Id: I63988f79b63977ae27eedd126a2bbdcaaa520e78
diff --git a/Android.bp b/Android.bp
index ba600ad..faca278 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1003,6 +1003,7 @@
":perfetto_src_ipc_client",
":perfetto_src_ipc_common",
":perfetto_src_ipc_host",
+ ":perfetto_src_ipc_perfetto_ipc",
":perfetto_src_kallsyms_kallsyms",
":perfetto_src_perfetto_cmd_perfetto_atoms",
":perfetto_src_protozero_protozero",
@@ -1251,6 +1252,7 @@
":perfetto_src_ipc_client",
":perfetto_src_ipc_common",
":perfetto_src_ipc_host",
+ ":perfetto_src_ipc_perfetto_ipc",
":perfetto_src_kallsyms_kallsyms",
":perfetto_src_perfetto_cmd_perfetto_atoms",
":perfetto_src_protozero_protozero",
@@ -1634,6 +1636,7 @@
":perfetto_src_ipc_client",
":perfetto_src_ipc_common",
":perfetto_src_ipc_host",
+ ":perfetto_src_ipc_perfetto_ipc",
":perfetto_src_kallsyms_kallsyms",
":perfetto_src_perfetto_cmd_perfetto_atoms",
":perfetto_src_profiling_common_callstack_trie",
@@ -6310,6 +6313,11 @@
],
}
+// GN: //src/ipc:perfetto_ipc
+filegroup {
+ name: "perfetto_src_ipc_perfetto_ipc",
+}
+
// GN: //src/ipc:test_messages_cpp
genrule {
name: "perfetto_src_ipc_test_messages_cpp_gen",