aboutsummaryrefslogtreecommitdiff
path: root/src/processor/stackwalk_common.cc
diff options
context:
space:
mode:
authorivanpe@chromium.org <ivanpe@chromium.org>2014-11-25 22:45:23 +0000
committerivanpe@chromium.org <ivanpe@chromium.org>2014-11-25 22:45:23 +0000
commit63919583ba0d302a2ceb437ecf41a7975f44f54b (patch)
tree41638178cfd8ae2637f3ebb4de31c5f49658029c /src/processor/stackwalk_common.cc
parentIntroduce microdump_stackwalk comand line executable (diff)
downloadbreakpad-63919583ba0d302a2ceb437ecf41a7975f44f54b.tar.xz
Surfacing the process create time in google_breakpad::ProcessState
and updating minidump_stackwalk to show process uptime. I tested this with a minidump from Chrome and I got a result that is inline with what the Windows debugger is showing for that dump: minidump_stackwalk output: -------------------------- Process uptime: 601 seconds WinDBG output: -------------- Process Uptime: 0 days 0:10:01.000 I didn't update the machine readable output of minidump_stackwalk on purpose in order to avoid breaking someone that uses it. It can be added later to the machine output if needed. R=mark@chromium.org Review URL: https://breakpad.appspot.com/7754002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1406 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/stackwalk_common.cc')
-rw-r--r--src/processor/stackwalk_common.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc
index 72398700..0a1707e2 100644
--- a/src/processor/stackwalk_common.cc
+++ b/src/processor/stackwalk_common.cc
@@ -672,6 +672,18 @@ void PrintProcessState(const ProcessState& process_state) {
printf("Assertion: %s\n", assertion.c_str());
}
+ // Compute process uptime if the process creation and crash times are
+ // available in the dump.
+ if (process_state.time_date_stamp() != 0 &&
+ process_state.process_create_time() != 0 &&
+ process_state.time_date_stamp() >= process_state.process_create_time()) {
+ printf("Process uptime: %d seconds\n",
+ process_state.time_date_stamp() -
+ process_state.process_create_time());
+ } else {
+ printf("Process uptime: not available\n");
+ }
+
// If the thread that requested the dump is known, print it first.
int requesting_thread = process_state.requesting_thread();
if (requesting_thread != -1) {