Index: snapshot/win/process_reader_win.cc |
diff --git a/snapshot/win/process_reader_win.cc b/snapshot/win/process_reader_win.cc |
index c0a3c56b454207a1b4669a3e2de9ae0ddba8a429..84e176b8739dcdee035210dcdeb6850d44d12db6 100644 |
--- a/snapshot/win/process_reader_win.cc |
+++ b/snapshot/win/process_reader_win.cc |
@@ -15,6 +15,7 @@ |
#include "snapshot/win/process_reader_win.h" |
#include "base/numerics/safe_conversions.h" |
+#include "util/win/time.h" |
namespace crashpad { |
@@ -54,6 +55,28 @@ bool ProcessReaderWin::ReadMemory(WinVMAddress at, |
return true; |
} |
+bool ProcessReaderWin::StartTime(timeval* start_time) const { |
+ FILETIME creation, exit, kernel, user; |
+ if (!GetProcessTimes(process_, &creation, &exit, &kernel, &user)) { |
+ PLOG(ERROR) << "GetProcessTimes"; |
+ return false; |
+ } |
+ *start_time = FiletimeToTimevalEpoch(creation); |
+ return true; |
+} |
+ |
+bool ProcessReaderWin::CPUTimes(timeval* user_time, |
+ timeval* system_time) const { |
+ FILETIME creation, exit, kernel, user; |
+ if (!GetProcessTimes(process_, &creation, &exit, &kernel, &user)) { |
+ PLOG(ERROR) << "GetProcessTimes"; |
+ return false; |
+ } |
+ *user_time = FiletimeToTimevalInterval(user); |
+ *system_time = FiletimeToTimevalInterval(kernel); |
+ return true; |
+} |
+ |
const std::vector<ProcessInfo::Module>& ProcessReaderWin::Modules() { |
INITIALIZATION_STATE_DCHECK_VALID(initialized_); |