From 79dd143e5fe135632963f02c186c63c300eb0bb1 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Wed, 21 Jun 2017 19:42:00 +0100 Subject: [PATCH] tombstoned: Improve message on java trace completion. For java traces, log the kind of dump as well as the PID of the completed dump. This makes it easier to correlate dump requests with the actual file they're written to. Sample log statement: E /system/bin/tombstoned: Traces for pid 4737 written to: /data/anr/trace_00 The message for native traces / tombstones remains unchanged because several tools parse it. Test: manual Bug: 32064548 Change-Id: I7b3792dd5ae312ee0bc055c22ec3f7c747152072 --- debuggerd/tombstoned/tombstoned.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/debuggerd/tombstoned/tombstoned.cpp b/debuggerd/tombstoned/tombstoned.cpp index b920ebc6b..355898d04 100644 --- a/debuggerd/tombstoned/tombstoned.cpp +++ b/debuggerd/tombstoned/tombstoned.cpp @@ -345,7 +345,14 @@ static void crash_completed_cb(evutil_socket_t sockfd, short ev, void* arg) { } if (!crash->crash_path.empty()) { - LOG(ERROR) << "Tombstone written to: " << crash->crash_path; + if (crash->crash_type == kDebuggerdJavaBacktrace) { + LOG(ERROR) << "Traces for pid " << crash->crash_pid << " written to: " << crash->crash_path; + } else { + // NOTE: Several tools parse this log message to figure out where the + // tombstone associated with a given native crash was written. Any changes + // to this message must be carefully considered. + LOG(ERROR) << "Tombstone written to: " << crash->crash_path; + } } fail: