diff options
author | sleffler@chromium.org <sleffler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 20:56:43 +0000 |
---|---|---|
committer | sleffler@chromium.org <sleffler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 20:56:43 +0000 |
commit | 190f13f73accbebd0e715c9f09db2f1c42b582ca (patch) | |
tree | 64cc444f1864f9a1cd1c81c6bb05940592883d88 /base/debug | |
parent | 2883287341c88da630585e227dbd94c624258cf9 (diff) | |
download | chromium_src-190f13f73accbebd0e715c9f09db2f1c42b582ca.zip chromium_src-190f13f73accbebd0e715c9f09db2f1c42b582ca.tar.gz chromium_src-190f13f73accbebd0e715c9f09db2f1c42b582ca.tar.bz2 |
Add interface to system trace clock.
Add TimeTicks::NowFromSystemTraceTime to return the current system trace
event clock (falling back to TimeTicks::HighResNow when not supported).
On systems where the system trace clock is available this allows
system and chrome events to be stamped with a common clock (eliminating
post-processing time shift adjustment that can be hard).
BUG=chromium-os:27809
TEST=unit tests + collect trace data on chrome os w/ kernel that supports clock_gettime(CLOCK_SYSTEM_TRACE)
Change-Id: Ia6a500bd13a6f09c49052a1dd1421027960d8dea
Review URL: http://codereview.chromium.org/10257020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/trace_event_impl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc index bd997cf..9cf3341 100644 --- a/base/debug/trace_event_impl.cc +++ b/base/debug/trace_event_impl.cc @@ -585,7 +585,7 @@ int TraceLog::AddTraceEvent(char phase, long long threshold, unsigned char flags) { DCHECK(name); - TimeTicks now = TimeTicks::HighResNow(); + TimeTicks now = TimeTicks::NowFromSystemTraceTime(); BufferFullCallback buffer_full_callback_copy; int ret_begin_id = -1; { @@ -710,7 +710,7 @@ void TraceLog::AddClockSyncMetadataEvents() { // debugfs that takes the written data and pushes it onto the trace // buffer. So, to establish clock sync, we write our monotonic clock into that // trace buffer. - TimeTicks now = TimeTicks::HighResNow(); + TimeTicks now = TimeTicks::NowFromSystemTraceTime(); double now_in_seconds = now.ToInternalValue() / 1000000.0; std::string marker = |