diff options
Diffstat (limited to 'chromium/base/profiler/stack_sampling_profiler.h')
-rw-r--r-- | chromium/base/profiler/stack_sampling_profiler.h | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/chromium/base/profiler/stack_sampling_profiler.h b/chromium/base/profiler/stack_sampling_profiler.h index c6784b8a8f4..1171cda73fc 100644 --- a/chromium/base/profiler/stack_sampling_profiler.h +++ b/chromium/base/profiler/stack_sampling_profiler.h @@ -72,30 +72,22 @@ class BASE_EXPORT StackSamplingProfiler { // Interval between samples during a sampling profile. This is the desired // duration from the start of one sample to the start of the next sample. TimeDelta sampling_interval = TimeDelta::FromMilliseconds(100); - - // When true, keeps the average sampling interval = |sampling_interval|, - // irrespective of how long each sample takes. If a sample takes too long, - // keeping the interval constant will lock out the sampled thread. When - // false, sample is created with an interval of |sampling_interval|, - // excluding the time taken by a sample. The metrics collected will not be - // accurate, since sampling could take arbitrary amount of time, but makes - // sure that the sampled thread gets at least the interval amount of time to - // run between samples. - bool keep_consistent_sampling_interval = true; }; - // Creates a profiler for the specified thread. |native_unwinder| is required - // on Android since the unwinder is provided outside StackSamplingProfiler, - // but must be null on other platforms. An optional |test_delegate| can be - // supplied by tests. + // Creates a profiler for the specified thread. |unwinders| is required on + // Android since the unwinder is provided outside StackSamplingProfiler, but + // must be empty on other platforms. When attempting to unwind, the relative + // priority of unwinders is the inverse of the order in |unwinders|. An + // optional |test_delegate| can be supplied by tests. // // The caller must ensure that this object gets destroyed before the thread // exits. - StackSamplingProfiler(SamplingProfilerThreadToken thread_token, - const SamplingParams& params, - std::unique_ptr<ProfileBuilder> profile_builder, - std::unique_ptr<Unwinder> native_unwinder = nullptr, - StackSamplerTestDelegate* test_delegate = nullptr); + StackSamplingProfiler( + SamplingProfilerThreadToken thread_token, + const SamplingParams& params, + std::unique_ptr<ProfileBuilder> profile_builder, + std::vector<std::unique_ptr<Unwinder>> core_unwinders = {}, + StackSamplerTestDelegate* test_delegate = nullptr); // Same as above function, with custom |sampler| implementation. The sampler // on Android is not implemented in base. @@ -153,6 +145,11 @@ class BASE_EXPORT StackSamplingProfiler { // runs. static void PerformSamplingThreadIdleShutdown( bool simulate_intervening_start); + + // Provides access to the method computing the next sample time. + static TimeTicks GetNextSampleTime(TimeTicks scheduled_current_sample_time, + TimeDelta sampling_interval, + TimeTicks now); }; private: @@ -191,10 +188,6 @@ class BASE_EXPORT StackSamplingProfiler { // thread sampling starts. std::unique_ptr<StackSampler> sampler_; - // If an AuxUnwinder is added before Start() it will be saved here until it - // can be passed to the sampling thread when thread sampling starts. - std::unique_ptr<Unwinder> pending_aux_unwinder_; - // This starts "signaled", is reset when sampling begins, and is signaled // when that sampling is complete and the profile_builder_'s // OnProfileCompleted function has executed. |