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

Unified Diff: base/message_loop/message_loop.cc

Issue 148613014: CC: Add 'cc-benchmark' traces for minimal tracing in benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minimum overhead toplevel tracing. Created 6 years, 10 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/message_loop/incoming_task_queue.cc ('k') | base/message_loop/message_pump_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 8f6c9d8cb6f0d0901d1a6d7fdb1d04b871adc6a9..4e446df557e8c32fa1d2d70e7af50bbe4cbb9c02 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -412,17 +412,23 @@ bool MessageLoop::ProcessNextDelayedNonNestableTask() {
}
void MessageLoop::RunTask(const PendingTask& pending_task) {
+ // For absolutely minimal tracing, "toplevel" captures _everything_
+ // on a typical message loop thread, so long as the thread runs
+ // semi-regular tasks (for sufficient measurement granularity).
epenner 2014/02/12 02:02:16 This is the primary tracing change. The rest just
+ TRACE_EVENT_END0("toplevel", "All");
+ TRACE_EVENT_BEGIN0("toplevel", "All");
+
tracked_objects::TrackedTime start_time =
tracked_objects::ThreadData::NowForStartOfRun(pending_task.birth_tally);
- TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
+ TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("task.flow"),
"MessageLoop::PostTask", TRACE_ID_MANGLE(GetTaskTraceID(pending_task)),
"queue_duration",
(start_time - pending_task.EffectiveTimePosted()).InMilliseconds());
// When tracing memory for posted tasks it's more valuable to attribute the
// memory allocations to the source function than generically to "RunTask".
TRACE_EVENT_WITH_MEMORY_TAG2(
- "toplevel", "MessageLoop::RunTask",
+ "task", "MessageLoop::RunTask",
pending_task.posted_from.function_name(), // Name for memory tracking.
"src_file", pending_task.posted_from.file_name(),
"src_func", pending_task.posted_from.function_name());
« no previous file with comments | « base/message_loop/incoming_task_queue.cc ('k') | base/message_loop/message_pump_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698