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

Unified Diff: chrome/common/stack_sampling_configuration.h

Issue 2409953004: Stack sampling profiler: enable at 10% for GPU process on canary (Closed)
Patch Set: clang fix 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
« no previous file with comments | « no previous file | chrome/common/stack_sampling_configuration.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/stack_sampling_configuration.h
diff --git a/chrome/common/stack_sampling_configuration.h b/chrome/common/stack_sampling_configuration.h
index 1400d741590863a1f036beff661c890c14b2c598..452c4eee9e62c0987d62c74dccabc1793135f31f 100644
--- a/chrome/common/stack_sampling_configuration.h
+++ b/chrome/common/stack_sampling_configuration.h
@@ -32,7 +32,8 @@ class StackSamplingConfiguration {
// Get the synthetic field trial configuration. Returns true if a synthetic
// field trial should be registered. This should only be called from the
- // browser process.
+ // browser process. When run at startup, the profiler must use a synthetic
+ // field trial since it runs before the metrics field trials are initialized.
bool GetSyntheticFieldTrial(std::string* trial_name,
std::string* group_name) const;
@@ -46,6 +47,7 @@ class StackSamplingConfiguration {
static StackSamplingConfiguration* Get();
private:
+ // Configuration to use for this Chrome instance.
enum ProfileConfiguration {
// Chrome-wide configurations set in the browser process.
PROFILE_DISABLED,
@@ -59,6 +61,18 @@ class StackSamplingConfiguration {
PROFILE_FROM_COMMAND_LINE
};
+ // Configuration variations, along with weights to use when randomly choosing
+ // one of a set of variations.
+ struct Variation {
+ ProfileConfiguration config;
+ int weight;
+ };
+
+ // Randomly chooses a configuration from the weighted variations. Weights are
+ // expected to sum to 100 as a sanity check.
+ static ProfileConfiguration ChooseConfiguration(
+ const std::vector<Variation>& variations);
+
// Generates sampling profiler configurations for all processes.
static ProfileConfiguration GenerateConfiguration();
« no previous file with comments | « no previous file | chrome/common/stack_sampling_configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698