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

Unified Diff: base/message_loop.cc

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup, run in all renderers Created 7 years, 6 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/debug/trace_memory.cc ('k') | chrome/browser/chrome_browser_main_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop.cc
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 0d8a8ef0d769875f386e244b69932779e9ed2271..3d4cf332b7627e2e7287b680bdba162fb33b11f5 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -458,9 +458,14 @@ bool MessageLoop::ProcessNextDelayedNonNestableTask() {
void MessageLoop::RunTask(const PendingTask& pending_task) {
TRACE_EVENT_FLOW_END0("task", "MessageLoop::PostTask",
TRACE_ID_MANGLE(GetTaskTraceID(pending_task, this)));
- TRACE_EVENT2("task", "MessageLoop::RunTask",
- "src_file", pending_task.posted_from.file_name(),
- "src_func", pending_task.posted_from.function_name());
+ // RunTask has special memory tracing needs. The file name where the task
+ // was posted is much more useful than "MessageLoop::RunTask" so we invoke
+ // the tracing macros separately with different strings.
+ // TODO(jamescook): Use TRACE_MEMORY2 here when it is implemented.
+ TRACE_MEMORY("task", pending_task.posted_from.file_name());
+ INTERNAL_TRACE_EVENT_ADD_SCOPED("task", "MessageLoop::RunTask",
+ "src_file", pending_task.posted_from.file_name(),
+ "src_func", pending_task.posted_from.function_name());
DCHECK(nestable_tasks_allowed_);
// Execute the task and assume the worst: It is probably not reentrant.
nestable_tasks_allowed_ = false;
« no previous file with comments | « base/debug/trace_memory.cc ('k') | chrome/browser/chrome_browser_main_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698