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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 7778033: Add trace code to track all posted tasks in message_loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trace_event.h formatting fix Created 9 years, 3 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/threading/worker_pool_posix.h ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index c3a382cd1c07fbbdfa288cebe79fb3d89adc8397..3a4408cab86ad32b3e4001088bb040e1550ffe66 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -5,6 +5,7 @@
#include "base/threading/worker_pool_posix.h"
#include "base/bind.h"
+#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@@ -83,6 +84,9 @@ void WorkerThread::ThreadMain() {
PosixDynamicThreadPool::PendingTask pending_task = pool_->WaitForTask();
if (pending_task.task.is_null())
break;
+ UNSHIPPED_TRACE_EVENT2("task", "WorkerThread::ThreadMain::Run",
+ "src_file", pending_task.posted_from.file_name(),
+ "src_func", pending_task.posted_from.function_name());
pending_task.task.Run();
}
@@ -107,7 +111,8 @@ bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
PosixDynamicThreadPool::PendingTask::PendingTask(
const tracked_objects::Location& posted_from,
const base::Closure& task)
- : task(task) {
+ : posted_from(posted_from),
+ task(task) {
}
PosixDynamicThreadPool::PendingTask::~PendingTask() {
« no previous file with comments | « base/threading/worker_pool_posix.h ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698