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

Unified Diff: base/debug/trace_event_impl.h

Issue 874543003: Add support for TraceEvent before the native library is loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Selectively enable startup tracing in ChromeShell. Created 5 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
Index: base/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index 1b1fce34cc209b452da54cad9b68f10696f4b79e..94016841d45a6e5937bd50b980f1857d050b567c 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -544,6 +544,17 @@ class BASE_EXPORT TraceLog {
void Flush(const OutputCallback& cb);
void FlushButLeaveBufferIntact(const OutputCallback& flush_output_callback);
+ // Can be called by clients to add custom events to the trace log without
+ // using the TRACE_EVENT* macros. This must only be called when category group
+ // is enabled for recording.
+ TraceEventHandle AddCustomTraceEvent(
dsinclair 2015/01/27 14:43:30 Instead of AddCustomTraceEvent, I think we should
Benoit L 2015/02/09 16:34:01 Done.
+ char phase,
+ const unsigned char* category_group_enabled,
+ const char* name,
+ int thread_id,
+ const TimeTicks& timestamp,
+ const TimeTicks& thread_time);
+
// Called by TRACE_EVENT* macros, don't call this directly.
// The name parameter is a category group for example:
// TRACE_EVENT0("renderer,webkit", "WebViewImpl::HandleInputEvent")
@@ -699,6 +710,21 @@ class BASE_EXPORT TraceLog {
const TimeTicks& timestamp,
TraceEvent* trace_event);
+ TraceEventHandle AddTraceEventInternal(
+ char phase,
+ const unsigned char* category_group_enabled,
+ const char* name,
+ unsigned long long id,
+ int thread_id,
+ const TimeTicks& timestamp,
+ const TimeTicks& thread_time,
+ int num_args,
+ const char** arg_names,
+ const unsigned char* arg_types,
+ const unsigned long long* arg_values,
+ const scoped_refptr<ConvertableToTraceFormat>* convertable_values,
+ unsigned char flags);
+
TraceEvent* AddEventToThreadSharedChunkWhileLocked(TraceEventHandle* handle,
bool check_buffer_is_full);
void CheckIfBufferIsFullWhileLocked();

Powered by Google App Engine
This is Rietveld 408576698