Move stack logging entirely into palette library
Make SignalCatcher::Output the same on host and target.
Apply same logic of when to log stacks to system logger as prior to
PaletteTombstonedMessage introduction.
Add PaletteStatus::kFailedCheckLog
Bug: 130025619
Test: art/tools/buildbot-build.sh --host -j100 && art/test.py --host -j32
Test: adb shell killall -QUIT system_server and check /data/anr
Test: Fill /data using 'dd', again send SIGQUIT to system and \
check logcat for stack traces.
Test: adb bugreport; check the produced report
Change-Id: I1b3b6780622b9799d61fb12ad11a28085729c5e9
diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc
index 20c85c1..8da5fee 100644
--- a/runtime/signal_catcher.cc
+++ b/runtime/signal_catcher.cc
@@ -103,18 +103,14 @@
}
void SignalCatcher::Output(const std::string& s) {
-#if defined(ART_TARGET_ANDROID)
ScopedThreadStateChange tsc(Thread::Current(), kWaitingForSignalCatcherOutput);
- PaletteStatus status = PaletteTombstonedMessage(s.data(), s.size());
+ PaletteStatus status = PaletteWriteCrashThreadStacks(s.data(), s.size());
if (status == PaletteStatus::kOkay) {
LOG(INFO) << "Wrote stack traces to tombstoned";
} else {
- CHECK(status == PaletteStatus::kCheckErrno);
- PLOG(ERROR) << "Failed to write stack traces to tombstoned";
+ CHECK(status == PaletteStatus::kFailedCheckLog);
+ LOG(ERROR) << "Failed to write stack traces to tombstoned";
}
-#else
- LOG(INFO) << s;
-#endif
}
void SignalCatcher::HandleSigQuit() {