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

Side by Side Diff: base/trace_event/trace_event_android.cc

Issue 1424703003: Kills TraceTicks, which was functionally the same as TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed win compile error. Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_event.h ('k') | base/trace_event/trace_event_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/trace_event_impl.h" 5 #include "base/trace_event/trace_event_impl.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 int atrace_fd = HANDLE_EINTR(open(kATraceMarkerFile, O_WRONLY | O_APPEND)); 194 int atrace_fd = HANDLE_EINTR(open(kATraceMarkerFile, O_WRONLY | O_APPEND));
195 if (atrace_fd == -1) { 195 if (atrace_fd == -1) {
196 PLOG(WARNING) << "Couldn't open " << kATraceMarkerFile; 196 PLOG(WARNING) << "Couldn't open " << kATraceMarkerFile;
197 return; 197 return;
198 } 198 }
199 199
200 // Android's kernel trace system has a trace_marker feature: this is a file on 200 // Android's kernel trace system has a trace_marker feature: this is a file on
201 // debugfs that takes the written data and pushes it onto the trace 201 // debugfs that takes the written data and pushes it onto the trace
202 // buffer. So, to establish clock sync, we write our monotonic clock into that 202 // buffer. So, to establish clock sync, we write our monotonic clock into that
203 // trace buffer. 203 // trace buffer.
204 double now_in_seconds = (TraceTicks::Now() - TraceTicks()).InSecondsF(); 204 double now_in_seconds = (TimeTicks::Now() - TimeTicks()).InSecondsF();
205 std::string marker = StringPrintf( 205 std::string marker = StringPrintf(
206 "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds); 206 "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds);
207 WriteToATrace(atrace_fd, marker.c_str(), marker.size()); 207 WriteToATrace(atrace_fd, marker.c_str(), marker.size());
208 close(atrace_fd); 208 close(atrace_fd);
209 } 209 }
210 210
211 } // namespace trace_event 211 } // namespace trace_event
212 } // namespace base 212 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/trace_event.h ('k') | base/trace_event/trace_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698