Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2229)

Unified Diff: base/process/internal_linux.h

Issue 21302005: Add CurrentProcessInfo::CreationTime() for Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.gypi ('k') | base/process/internal_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/internal_linux.h
diff --git a/base/process/internal_linux.h b/base/process/internal_linux.h
index 88d32eee769685ac19142b46a1ec9c31626b06ab..a10cee36e5669f71cf1e570f56af27b4cadb8389 100644
--- a/base/process/internal_linux.h
+++ b/base/process/internal_linux.h
@@ -11,6 +11,10 @@
#include "base/files/file_path.h"
namespace base {
+
+class Time;
+class TimeDelta;
+
namespace internal {
// "/proc"
@@ -49,6 +53,7 @@ enum ProcStatsFields {
VM_UTIME = 13, // Time scheduled in user mode in clock ticks.
VM_STIME = 14, // Time scheduled in kernel mode in clock ticks.
VM_NUMTHREADS = 19, // Number of threads.
+ VM_STARTTIME = 21, // The time the process started in clock ticks.
VM_VSIZE = 22, // Virtual memory size in bytes.
VM_RSS = 23, // Resident Set Size in pages.
};
@@ -72,6 +77,12 @@ int ReadProcStatsAndGetFieldAsInt(pid_t pid,
size_t ReadProcStatsAndGetFieldAsSizeT(pid_t pid,
ProcStatsFields field_num);
+// Returns the time that the OS started. Clock ticks are relative to this.
+Time GetBootTime();
+
+// Converts Linux clock ticks to a wall time delta.
+TimeDelta ClockTicksToTimeDelta(int clock_ticks);
+
} // namespace internal
} // namespace base
« no previous file with comments | « base/base.gypi ('k') | base/process/internal_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698