ART: Report cputime in dex2oat
Add ProcessCpuNanoTime. Log cputime in dex2oat completion message.
Sample:
dex2oat took 20.036s(64.843s cpu) (threads: 48) arena alloc=25MB (26760672B) java alloc=2MB (2311688B) native alloc=44MB (46792784B) free=35MB (37502896B)
Test: m test-art-host
Change-Id: I78646c4808c8205f7f8e7995a82a1ba63cd15298
diff --git a/runtime/base/time_utils.h b/runtime/base/time_utils.h
index 383b52f..dbb8bcd 100644
--- a/runtime/base/time_utils.h
+++ b/runtime/base/time_utils.h
@@ -62,6 +62,9 @@
// Returns the thread-specific CPU-time clock in nanoseconds or -1 if unavailable.
uint64_t ThreadCpuNanoTime();
+// Returns the process CPU-time clock in nanoseconds or -1 if unavailable.
+uint64_t ProcessCpuNanoTime();
+
// Converts the given number of nanoseconds to milliseconds.
static constexpr inline uint64_t NsToMs(uint64_t ns) {
return ns / 1000 / 1000;