heapprofd: fork model mode-select groundwork
This patch introduces:
* the flags necessary for heapprofd to start as a "child" for a given
process.
* logic to fork-exec heapprofd in malloc hook initialization.
If using the fork model, both the hook & private heapprofd exit without
doing much for now.
On user builds (based on "ro.build.type" sysprop), we always select the
fork model. On userdebug/eng, we consult a secondary sysprop,
"heapprofd.userdebug.mode", and use fork if it's set to "fork".
Aside: note that I'm proposing userdebug mode-selection to be global in
nature (not per-datasource).
Bug: 120185246
Change-Id: I9afbc725a2a626c40a0af358536e001a280e53a9
diff --git a/src/profiling/memory/client.h b/src/profiling/memory/client.h
index 36d220e..f71109b 100644
--- a/src/profiling/memory/client.h
+++ b/src/profiling/memory/client.h
@@ -123,6 +123,8 @@
bool valid_;
};
+constexpr uint32_t kClientSockTxTimeoutMs = 1000;
+
// This is created and owned by the malloc hooks.
class Client {
public: