From 92c7d70d7ce9ca5bae4686d415267802bd69be85 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 31 Dec 2018 12:14:01 +0000 Subject: dumpstate: Improve error message for failed dumps. Format the header / footer in the same way as successful dumps and include the PID in the failure message. Test: Manual Bug: 118090541 Change-Id: I17f51c816f4d3ebda4cd157b8d05be64008fb81e --- cmds/dumpstate/utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmds/dumpstate/utils.cpp') diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp index d97ffbf2ed..990fd43fd4 100644 --- a/cmds/dumpstate/utils.cpp +++ b/cmds/dumpstate/utils.cpp @@ -871,7 +871,11 @@ const char* dump_traces() { is_java_process ? 5 : 20, fd); if (ret == -1) { - dprintf(fd, "dumping failed, likely due to a timeout\n"); + // For consistency, the header and footer to this message match those + // dumped by debuggerd in the success case. + dprintf(fd, "\n---- pid %d at [unknown] ----\n", pid); + dprintf(fd, "Dump failed, likely due to a timeout.\n"); + dprintf(fd, "---- end %d ----", pid); timeout_failures++; continue; } -- cgit v1.2.3-59-g8ed1b