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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1406213005: [tracing] Add names to memory-infra dumpers for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory-infra-runtime
Patch Set: Rebase + fix android Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 if (parsed_command_line_.HasSwitch( 660 if (parsed_command_line_.HasSwitch(
661 switches::kEnableAggressiveDOMStorageFlushing)) { 661 switches::kEnableAggressiveDOMStorageFlushing)) {
662 TRACE_EVENT0("startup", 662 TRACE_EVENT0("startup",
663 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); 663 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay");
664 DOMStorageArea::EnableAggressiveCommitDelay(); 664 DOMStorageArea::EnableAggressiveCommitDelay();
665 } 665 }
666 666
667 // Enable memory-infra dump providers. 667 // Enable memory-infra dump providers.
668 InitSkiaEventTracer(); 668 InitSkiaEventTracer();
669 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 669 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
670 HostSharedBitmapManager::current()); 670 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr);
671 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 671 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
672 skia::SkiaMemoryDumpProvider::GetInstance()); 672 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);
673 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 673 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
674 sql::SqlMemoryDumpProvider::GetInstance()); 674 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr);
675 675
676 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 676 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
677 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 677 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
678 base::MessageLoop::current()->task_runner(), 678 base::MessageLoop::current()->task_runner(),
679 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, 679 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop,
680 ::GetHeapProfile)); 680 ::GetHeapProfile));
681 #endif 681 #endif
682 } 682 }
683 683
684 int BrowserMainLoop::PreCreateThreads() { 684 int BrowserMainLoop::PreCreateThreads() {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 if (aura::Env::GetInstance()) { 1188 if (aura::Env::GetInstance()) {
1189 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); 1189 aura::Env::GetInstance()->set_context_factory(GetContextFactory());
1190 } 1190 }
1191 #endif // defined(USE_AURA) 1191 #endif // defined(USE_AURA)
1192 #endif // defined(OS_ANDROID) 1192 #endif // defined(OS_ANDROID)
1193 1193
1194 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that 1194 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that
1195 // unregistration happens on the IO thread (See 1195 // unregistration happens on the IO thread (See
1196 // BrowserProcessSubThread::IOThreadPreCleanUp). 1196 // BrowserProcessSubThread::IOThreadPreCleanUp).
1197 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1197 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1198 BrowserGpuMemoryBufferManager::current(), io_thread_->task_runner()); 1198 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager",
1199 io_thread_->task_runner());
1199 #if defined(OS_ANDROID) 1200 #if defined(OS_ANDROID)
1200 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1201 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1201 tracing::GraphicsMemoryDumpProvider::GetInstance()); 1202 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics",
1203 nullptr);
1202 #endif 1204 #endif
1203 1205
1204 { 1206 {
1205 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); 1207 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan");
1206 audio_manager_.reset(media::AudioManager::CreateWithHangTimer( 1208 audio_manager_.reset(media::AudioManager::CreateWithHangTimer(
1207 MediaInternals::GetInstance(), io_thread_->task_runner())); 1209 MediaInternals::GetInstance(), io_thread_->task_runner()));
1208 } 1210 }
1209 1211
1210 { 1212 {
1211 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager"); 1213 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager");
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 DCHECK(is_tracing_startup_for_duration_); 1424 DCHECK(is_tracing_startup_for_duration_);
1423 1425
1424 is_tracing_startup_for_duration_ = false; 1426 is_tracing_startup_for_duration_ = false;
1425 TracingController::GetInstance()->DisableRecording( 1427 TracingController::GetInstance()->DisableRecording(
1426 TracingController::CreateFileSink( 1428 TracingController::CreateFileSink(
1427 startup_trace_file_, 1429 startup_trace_file_,
1428 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1430 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1429 } 1431 }
1430 1432
1431 } // namespace content 1433 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/child_trace_message_filter_browsertest.cc ('k') | content/browser/tracing/memory_tracing_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698