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

Unified Diff: base/profiler/stack_sampling_profiler.h

Issue 1316153002: StackSamplingProfiler: collect partial bursts if the profiler is stopped early (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 5 years, 4 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 | base/profiler/stack_sampling_profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/stack_sampling_profiler.h
diff --git a/base/profiler/stack_sampling_profiler.h b/base/profiler/stack_sampling_profiler.h
index 5a6c3d0514d00a337d462f06e79c0e89ced5a249..9aad10fbeda7fb3d8b111092d6741a60c2b01940 100644
--- a/base/profiler/stack_sampling_profiler.h
+++ b/base/profiler/stack_sampling_profiler.h
@@ -51,8 +51,7 @@ class NativeStackSampler;
//
// When all call stack profiles are complete, or the profiler is stopped, the
// completed callback is called from a thread created by the profiler with the
-// completed profiles. A profile is considered complete if all requested samples
-// were recorded for the profile (i.e. it was not stopped prematurely).
+// collected profiles.
//
// The results of the profiling are passed to the completed callback and consist
// of a vector of CallStackProfiles. Each CallStackProfile corresponds to a
@@ -195,14 +194,15 @@ class BASE_EXPORT StackSamplingProfiler {
void Stop();
private:
- // Collects a call stack profile from a single burst. Returns true if the
- // profile was collected, or false if collection was stopped before it
- // completed.
- bool CollectProfile(CallStackProfile* profile, TimeDelta* elapsed_time);
+ // Collects |profile| from a single burst. If the profiler was stopped
+ // during collection, sets |was_stopped| and provides the set of samples
+ // collected up to that point.
+ void CollectProfile(CallStackProfile* profile, TimeDelta* elapsed_time,
+ bool* was_stopped);
// Collects call stack profiles from all bursts, or until the sampling is
- // stopped. If stopped before complete, |call_stack_profiles| will contain
- // only full bursts.
+ // stopped. If stopped before complete, the last profile in
+ // |call_stack_profiles| may contain a partial burst.
void CollectProfiles(CallStackProfiles* profiles);
scoped_ptr<NativeStackSampler> native_sampler_;
« no previous file with comments | « no previous file | base/profiler/stack_sampling_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698