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

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

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: dNits. 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/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/memory_pressure_monitor.h" 12 #include "base/memory/memory_pressure_monitor.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/pending_task.h" 15 #include "base/pending_task.h"
16 #include "base/power_monitor/power_monitor.h" 16 #include "base/power_monitor/power_monitor.h"
17 #include "base/power_monitor/power_monitor_device_source.h" 17 #include "base/power_monitor/power_monitor_device_source.h"
18 #include "base/process/process_metrics.h" 18 #include "base/process/process_metrics.h"
19 #include "base/profiler/scoped_profile.h" 19 #include "base/profiler/scoped_profile.h"
20 #include "base/run_loop.h" 20 #include "base/run_loop.h"
21 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
22 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
23 #include "base/strings/string_split.h" 23 #include "base/strings/string_split.h"
24 #include "base/system_monitor/system_monitor.h" 24 #include "base/system_monitor/system_monitor.h"
25 #include "base/thread_task_runner_handle.h" 25 #include "base/thread_task_runner_handle.h"
26 #include "base/threading/thread_restrictions.h" 26 #include "base/threading/thread_restrictions.h"
27 #include "base/timer/hi_res_timer_manager.h" 27 #include "base/timer/hi_res_timer_manager.h"
28 #include "base/trace_event/memory_dump_manager.h" 28 #include "base/trace_event/memory_dump_manager.h"
29 #include "base/trace_event/trace_event.h" 29 #include "base/trace_event/trace_event.h"
30 #include "components/tracing/process_metrics_memory_dump_manager.h"
30 #include "components/tracing/trace_config_file.h" 31 #include "components/tracing/trace_config_file.h"
31 #include "components/tracing/tracing_switches.h" 32 #include "components/tracing/tracing_switches.h"
32 #include "content/browser/browser_thread_impl.h" 33 #include "content/browser/browser_thread_impl.h"
33 #include "content/browser/device_sensors/device_inertial_sensor_service.h" 34 #include "content/browser/device_sensors/device_inertial_sensor_service.h"
34 #include "content/browser/dom_storage/dom_storage_area.h" 35 #include "content/browser/dom_storage/dom_storage_area.h"
35 #include "content/browser/download/save_file_manager.h" 36 #include "content/browser/download/save_file_manager.h"
36 #include "content/browser/gamepad/gamepad_service.h" 37 #include "content/browser/gamepad/gamepad_service.h"
37 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 38 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
38 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 39 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
39 #include "content/browser/gpu/compositor_util.h" 40 #include "content/browser/gpu/compositor_util.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 665
665 if (parsed_command_line_.HasSwitch( 666 if (parsed_command_line_.HasSwitch(
666 switches::kEnableAggressiveDOMStorageFlushing)) { 667 switches::kEnableAggressiveDOMStorageFlushing)) {
667 TRACE_EVENT0("startup", 668 TRACE_EVENT0("startup",
668 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); 669 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay");
669 DOMStorageArea::EnableAggressiveCommitDelay(); 670 DOMStorageArea::EnableAggressiveCommitDelay();
670 } 671 }
671 672
672 // Enable memory-infra dump providers. 673 // Enable memory-infra dump providers.
673 InitSkiaEventTracer(); 674 InitSkiaEventTracer();
675 tracing::ProcessMetricsMemoryDumpManager::GetInstance()->RegisterForProcess(
676 base::kNullProcessHandle);
674 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 677 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
675 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); 678 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr);
676 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 679 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
677 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); 680 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);
678 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 681 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
679 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); 682 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr);
680 683
681 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 684 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
682 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( 685 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController(
683 base::MessageLoop::current()->task_runner(), 686 base::MessageLoop::current()->task_runner(),
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 DCHECK(is_tracing_startup_for_duration_); 1436 DCHECK(is_tracing_startup_for_duration_);
1434 1437
1435 is_tracing_startup_for_duration_ = false; 1438 is_tracing_startup_for_duration_ = false;
1436 TracingController::GetInstance()->DisableRecording( 1439 TracingController::GetInstance()->DisableRecording(
1437 TracingController::CreateFileSink( 1440 TracingController::CreateFileSink(
1438 startup_trace_file_, 1441 startup_trace_file_,
1439 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1442 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1440 } 1443 }
1441 1444
1442 } // namespace content 1445 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698