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

Unified Diff: chrome/gpu/chrome_content_gpu_client.cc

Issue 2360143006: Stack sampling profiler: run the profiler in the GPU process on trunk builds (Closed)
Patch Set: address comments Created 4 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 | « chrome/gpu/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/chrome_content_gpu_client.cc
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc
index 1c93cf13023d5fb0a57ed5a18216501ee0d34801..3403ef54d5f349b08ada0a808ae5df205f18ed46 100644
--- a/chrome/gpu/chrome_content_gpu_client.cc
+++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -11,6 +11,7 @@
#include "base/memory/ptr_util.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "chrome/common/stack_sampling_configuration.h"
#include "components/metrics/child_call_stack_profile_collector.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/shell/public/cpp/connector.h"
@@ -40,16 +41,6 @@ void CreateGpuArcVideoService(
}
#endif
-// Returns appropriate parameters for stack sampling on startup.
-base::StackSamplingProfiler::SamplingParams GetStartupSamplingParams() {
- base::StackSamplingProfiler::SamplingParams params;
- params.initial_delay = base::TimeDelta::FromMilliseconds(0);
- params.bursts = 1;
- params.samples_per_burst = 300;
- params.sampling_interval = base::TimeDelta::FromMilliseconds(100);
- return params;
-}
-
base::LazyInstance<metrics::ChildCallStackProfileCollector>::Leaky
g_call_stack_profile_collector = LAZY_INSTANCE_INITIALIZER;
@@ -58,13 +49,15 @@ base::LazyInstance<metrics::ChildCallStackProfileCollector>::Leaky
ChromeContentGpuClient::ChromeContentGpuClient()
: stack_sampling_profiler_(
base::PlatformThread::CurrentId(),
- GetStartupSamplingParams(),
+ StackSamplingConfiguration::Get()->GetSamplingParamsForCurrentProcess(),
g_call_stack_profile_collector.Get().GetProfilerCallback(
metrics::CallStackProfileParams(
metrics::CallStackProfileParams::GPU_PROCESS,
metrics::CallStackProfileParams::GPU_MAIN_THREAD,
metrics::CallStackProfileParams::PROCESS_STARTUP,
metrics::CallStackProfileParams::MAY_SHUFFLE))) {
+ if (StackSamplingConfiguration::Get()->IsProfilerEnabledForCurrentProcess())
+ stack_sampling_profiler_.Start();
}
ChromeContentGpuClient::~ChromeContentGpuClient() {}
« no previous file with comments | « chrome/gpu/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698