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

Unified Diff: base/debug/trace_event_impl.h

Issue 11345019: Make Chrome Trace work with Android ATrace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove redundant checking Created 8 years, 2 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
Index: base/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index 62a81d88ab2a7861e8313c7b589e934885a9574f..c1863738f5c07f1d8adbacaf697746d55cfd9c8e 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -82,6 +82,10 @@ class BASE_EXPORT TraceEvent {
std::string* out);
void AppendAsJSON(std::string* out) const;
+ static void AppendValueAsJSON(unsigned char type,
+ TraceValue value,
+ std::string* out);
+
TimeTicks timestamp() const { return timestamp_; }
// Exposed for unittesting:
@@ -204,6 +208,11 @@ class BASE_EXPORT TraceLog {
void SetEnabled(bool enabled);
bool IsEnabled() { return enabled_; }
+#if defined(OS_ANDROID)
+ static void InitATrace();
+ static bool IsATraceEnabled();
+#endif
+
// Enabled state listeners give a callback when tracing is enabled or
// disabled. This can be used to tie into other library's tracing systems
// on-demand.
@@ -334,7 +343,17 @@ class BASE_EXPORT TraceLog {
~TraceLog();
const unsigned char* GetCategoryEnabledInternal(const char* name);
void AddThreadNameMetadataEvents();
+
+#if defined(OS_ANDROID)
+ void SendToATrace(char phase,
+ const char* category,
+ const char* name,
+ int num_args,
+ const char** arg_names,
+ const unsigned char* arg_types,
+ const unsigned long long* arg_values);
void AddClockSyncMetadataEvents();
+#endif
// TODO(nduca): switch to per-thread trace buffers to reduce thread
// synchronization.

Powered by Google App Engine
This is Rietveld 408576698