aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-03-20 23:12:15 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-03-20 23:12:15 +0000
commit78fab2035378f46b2917b2108302593f7a62b46f (patch)
tree6620825e0cbbb22e90e86786a8244b894bca9e81
parent24490247ba8e2fb6627af984376617f51677241b (diff)
parent7696e800b89ca053010aeace2a8e6eae659a4104 (diff)
downloadperfetto-android10-qpr3-release.tar.gz
Change-Id: I7d82583eecdcf99df2acee27074bcfa59ab92f91
-rw-r--r--src/profiling/memory/client.cc13
-rw-r--r--src/profiling/memory/unwinding.cc4
2 files changed, 7 insertions, 10 deletions
diff --git a/src/profiling/memory/client.cc b/src/profiling/memory/client.cc
index 59c7e20d5..37453d13d 100644
--- a/src/profiling/memory/client.cc
+++ b/src/profiling/memory/client.cc
@@ -202,10 +202,7 @@ std::shared_ptr<Client> Client::CreateAndHandshake(
}
PERFETTO_DCHECK(client_config.interval >= 1);
- // TODO(fmayer): Always make this nonblocking.
- // This is so that without block_client, we get the old behaviour that rate
- // limits using the blocking socket. We do not want to change that for Q.
- sock.SetBlocking(!client_config.block_client);
+ sock.SetBlocking(false);
Sampler sampler{client_config.interval};
// note: the shared_ptr will retain a copy of the unhooked_allocator
return std::allocate_shared<Client>(unhooked_allocator, std::move(sock),
@@ -368,10 +365,12 @@ bool Client::IsConnected() {
}
bool Client::SendControlSocketByte() {
- // TODO(fmayer): Fix the special casing that only block_client uses a
- // nonblocking socket.
+ // If base::IsAgain(errno), the socket buffer is full, so the service will
+ // pick up the notification even without adding another byte.
+ // In other error cases (usually EPIPE) we want to disconnect, because that
+ // is how the service signals the tracing session was torn down.
if (sock_.Send(kSingleByte, sizeof(kSingleByte)) == -1 &&
- (!client_config_.block_client || !base::IsAgain(errno))) {
+ !base::IsAgain(errno)) {
PERFETTO_PLOG("Failed to send control socket byte.");
return false;
}
diff --git a/src/profiling/memory/unwinding.cc b/src/profiling/memory/unwinding.cc
index cc79477b7..31b9a9c96 100644
--- a/src/profiling/memory/unwinding.cc
+++ b/src/profiling/memory/unwinding.cc
@@ -314,9 +314,7 @@ void UnwindingWorker::HandleUnwindBatch(pid_t peer_pid) {
shmem.EndRead(std::move(buf));
// Reparsing takes time, so process the rest in a new batch to avoid timing
// out.
- // TODO(fmayer): Do not special case blocking mode.
- if (client_data.client_config.block_client &&
- reparses_before < client_data.metadata.reparses) {
+ if (reparses_before < client_data.metadata.reparses) {
repost_task = true;
break;
}