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

Unified Diff: base/trace_event/trace_log.cc

Issue 2967023002: android: Add thread time to early TraceEvent, make timings more precise. (Closed)
Patch Set: Comment. Created 3 years, 5 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 | « base/trace_event/trace_log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_log.cc
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc
index 87e48fcafd219d8f825c7cb699e256ae783fb5cd..4e8bc3252516b6bf291e78a71ecb8b51a97aaf12 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -1381,17 +1381,27 @@ void TraceLog::UpdateTraceEventDuration(
if (!category_group_enabled_local)
return;
+ UpdateTraceEventDurationExplicit(category_group_enabled, name, handle,
+ OffsetNow(), ThreadNow());
+}
+
+void TraceLog::UpdateTraceEventDurationExplicit(
+ const unsigned char* category_group_enabled,
+ const char* name,
+ TraceEventHandle handle,
+ const TimeTicks& now,
+ const ThreadTicks& thread_now) {
+ char category_group_enabled_local = *category_group_enabled;
+ if (!category_group_enabled_local)
+ return;
+
// Avoid re-entrance of AddTraceEvent. This may happen in GPU process when
// ECHO_TO_CONSOLE is enabled: AddTraceEvent -> LOG(ERROR) ->
// GpuProcessLogMessageHandler -> PostPendingTask -> TRACE_EVENT ...
if (thread_is_in_trace_event_.Get())
return;
-
AutoThreadLocalBoolean thread_is_in_trace_event(&thread_is_in_trace_event_);
- ThreadTicks thread_now = ThreadNow();
- TimeTicks now = OffsetNow();
-
#if defined(OS_WIN)
// Generate an ETW event that marks the end of a complete event.
if (category_group_enabled_local & TraceCategory::ENABLED_FOR_ETW_EXPORT)
« no previous file with comments | « base/trace_event/trace_log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698