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

Unified Diff: base/debug/trace_event_android.cc

Issue 12025014: Android: removes "trace_event_clock_sync" from atrace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « no previous file | base/debug/trace_event_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_android.cc
diff --git a/base/debug/trace_event_android.cc b/base/debug/trace_event_android.cc
index c56c3c1220d2fdbbfc7ac999bf366004fcf5704b..c45082e858dc54614d9bb3a53e26a55714700066 100644
--- a/base/debug/trace_event_android.cc
+++ b/base/debug/trace_event_android.cc
@@ -89,51 +89,6 @@ void TraceLog::SendToATrace(char phase,
}
}
-void TraceLog::AddClockSyncMetadataEvents() {
- // Since Android does not support sched_setaffinity, we cannot establish clock
- // sync unless the scheduler clock is set to global. If the trace_clock file
- // can't be read, we will assume the kernel doesn't support tracing and do
- // nothing.
- std::string clock_mode;
- if (!file_util::ReadFileToString(
- FilePath("/sys/kernel/debug/tracing/trace_clock"), &clock_mode))
- return;
-
- if (clock_mode != "local [global]\n") {
- DLOG(WARNING) <<
- "The kernel's tracing clock must be set to global in order for " <<
- "trace_event to be synchronized with . Do this by\n" <<
- " echo global > /sys/kerel/debug/tracing/trace_clock";
- return;
- }
-
- int atrace_fd = g_atrace_fd;
- if (atrace_fd == -1) {
- // This function may be called when atrace is not enabled.
- atrace_fd = open(kATraceMarkerFile, O_WRONLY | O_APPEND);
- if (atrace_fd == -1) {
- LOG(WARNING) << "Couldn't open " << kATraceMarkerFile;
- return;
- }
- }
-
- // Android's kernel trace system has a trace_marker feature: this is a file on
- // 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::NowFromSystemTraceTime();
- double now_in_seconds = now.ToInternalValue() / 1000000.0;
- std::string marker = StringPrintf(
- "trace_event_clock_sync: parent_ts=%f\n", now_in_seconds);
- if (write(atrace_fd, marker.c_str(), marker.size()) != 0) {
- DLOG(WARNING) << "Couldn't write to " << kATraceMarkerFile << ": "
- << strerror(errno);
- }
-
- if (g_atrace_fd == -1)
- close(atrace_fd);
-}
-
// Must be called with lock_ locked.
void TraceLog::ApplyATraceEnabledFlag(unsigned char* category_enabled) {
if (g_atrace_fd != -1)
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698