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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 2386123003: Add heap allocator usage to task profiler. (Closed)
Patch Set: Figure out where the @#$%! corruption is coming from. Move heap tracking to TaskStopwatch." Created 4 years, 2 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/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index aee5caccfbc7c75587d13a4afd419bf16c41fbe4..b30a6cc35965550c336cf191cc75d16f75d68928 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/debug/scoped_thread_heap_usage.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -89,12 +90,16 @@ void WorkerThread::ThreadMain() {
TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", pending_task);
tracked_objects::TaskStopwatch stopwatch;
+ base::debug::ScopedThreadHeapUsage heap_usage;
+ heap_usage.Start();
stopwatch.Start();
pending_task.task.Run();
stopwatch.Stop();
+ heap_usage.Stop();
tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
- pending_task.birth_tally, pending_task.time_posted, stopwatch);
+ pending_task.birth_tally, pending_task.time_posted, stopwatch,
+ heap_usage.usage());
}
// The WorkerThread is non-joinable, so it deletes itself.

Powered by Google App Engine
This is Rietveld 408576698