diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 21:45:06 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 21:45:06 +0000 |
commit | b4acabccade62eb5d561a3ffcbc47070e6ae9e70 (patch) | |
tree | 18fb1a8cb7c57057869a11c0ec482b3f0aa3e751 /base/debug | |
parent | 817fa8377dc8716f96fd85420fbbad1abfdfce74 (diff) | |
download | chromium_src-b4acabccade62eb5d561a3ffcbc47070e6ae9e70.zip chromium_src-b4acabccade62eb5d561a3ffcbc47070e6ae9e70.tar.gz chromium_src-b4acabccade62eb5d561a3ffcbc47070e6ae9e70.tar.bz2 |
Android: removes "trace_event_clock_sync" from atrace.
This event was written to debugfs when trace was finished.
It happens on the UI thread and IO is not allowed.
BUG=170284
Review URL: https://chromiumcodereview.appspot.com/12025014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/trace_event_android.cc | 47 | ||||
-rw-r--r-- | base/debug/trace_event_impl.cc | 3 | ||||
-rw-r--r-- | base/debug/trace_event_impl.h | 1 |
3 files changed, 0 insertions, 51 deletions
diff --git a/base/debug/trace_event_android.cc b/base/debug/trace_event_android.cc index c56c3c1..29e684a 100644 --- a/base/debug/trace_event_android.cc +++ b/base/debug/trace_event_android.cc @@ -7,8 +7,6 @@ #include <fcntl.h> #include "base/debug/trace_event.h" -#include "base/file_util.h" -#include "base/format_macros.h" #include "base/logging.h" #include "base/stringprintf.h" @@ -89,51 +87,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) diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc index 50c0d82..e85db1d 100644 --- a/base/debug/trace_event_impl.cc +++ b/base/debug/trace_event_impl.cc @@ -572,9 +572,6 @@ void TraceLog::SetDisabled() { for (int i = 0; i < g_category_index; i++) g_category_enabled[i] = 0; AddThreadNameMetadataEvents(); -#if defined(OS_ANDROID) - AddClockSyncMetadataEvents(); -#endif } void TraceLog::SetEnabled(bool enabled) { diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h index fb9c579..58a44da 100644 --- a/base/debug/trace_event_impl.h +++ b/base/debug/trace_event_impl.h @@ -359,7 +359,6 @@ class BASE_EXPORT TraceLog { const char** arg_names, const unsigned char* arg_types, const unsigned long long* arg_values); - void AddClockSyncMetadataEvents(); static void ApplyATraceEnabledFlag(unsigned char* category_enabled); #endif |