Move all logging to use the async safe logging.
Also, add a link to the .clang-format-2 for this directory and clang
format the files that changed.
Bug: 31919199
Test: Boot bullhead.
Test: Run unit tests on bullhead. There are a few that fail, but they
Test: failed before and are not a result of this change.
Change-Id: I3d3b2111f6f6bf8a0d7039295d34d5168c191651
diff --git a/PtracerThread.cpp b/PtracerThread.cpp
index 4e3c41e..73b0493 100644
--- a/PtracerThread.cpp
+++ b/PtracerThread.cpp
@@ -70,7 +70,7 @@
child_pid_(0) {
stack_ = std::make_unique<Stack>(PTHREAD_STACK_MIN);
if (stack_->top() == nullptr) {
- LOG_ALWAYS_FATAL("failed to mmap child stack: %s", strerror(errno));
+ MEM_LOG_ALWAYS_FATAL("failed to mmap child stack: %s", strerror(errno));
}
func_ = std::function<int()>{[&, func]() -> int {
@@ -102,7 +102,7 @@
CLONE_VM|CLONE_FS|CLONE_FILES/*|CLONE_UNTRACED*/,
reinterpret_cast<void*>(&func_));
if (child_pid_ < 0) {
- ALOGE("failed to clone child: %s", strerror(errno));
+ MEM_ALOGE("failed to clone child: %s", strerror(errno));
return false;
}
@@ -120,7 +120,7 @@
int status;
int ret = TEMP_FAILURE_RETRY(waitpid(child_pid_, &status, __WALL));
if (ret < 0) {
- ALOGE("waitpid %d failed: %s", child_pid_, strerror(errno));
+ MEM_ALOGE("waitpid %d failed: %s", child_pid_, strerror(errno));
return -1;
}
@@ -131,7 +131,7 @@
} else if (WIFSIGNALED(status)) {
return -WTERMSIG(status);
} else {
- ALOGE("unexpected status %x", status);
+ MEM_ALOGE("unexpected status %x", status);
return -1;
}
}