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

Side by Side Diff: components/metrics/child_call_stack_profile_collector.h

Issue 2927593002: Make stack sampling profiler sample beyond startup. (Closed)
Patch Set: Address some comments. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_ 5 #ifndef COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_
6 #define COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_ 6 #define COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // The sampled profiles. 84 // The sampled profiles.
85 base::StackSamplingProfiler::CallStackProfiles profiles; 85 base::StackSamplingProfiler::CallStackProfiles profiles;
86 86
87 private: 87 private:
88 DISALLOW_COPY_AND_ASSIGN(ProfilesState); 88 DISALLOW_COPY_AND_ASSIGN(ProfilesState);
89 }; 89 };
90 90
91 using CallStackProfile = base::StackSamplingProfiler::CallStackProfile; 91 using CallStackProfile = base::StackSamplingProfiler::CallStackProfile;
92 92
93 void Collect(const CallStackProfileParams& params, 93 bool Collect(const CallStackProfileParams& params,
94 base::TimeTicks start_timestamp, 94 base::TimeTicks start_timestamp,
95 std::vector<CallStackProfile> profiles); 95 std::vector<CallStackProfile> profiles,
96 base::StackSamplingProfiler::SamplingParams* sampling_params);
97
98 void CollectImpl(const CallStackProfileParams& params,
99 base::TimeTicks start_timestamp,
100 std::vector<CallStackProfile> profiles);
96 101
97 // This object may be accessed on any thread, including the profiler 102 // This object may be accessed on any thread, including the profiler
98 // thread. The expected use case for the object is to be created and have 103 // thread. The expected use case for the object is to be created and have
99 // GetProfilerCallback before the message loop starts, which prevents the use 104 // GetProfilerCallback before the message loop starts, which prevents the use
100 // of PostTask and the like for inter-thread communication. 105 // of PostTask and the like for inter-thread communication.
101 base::Lock lock_; 106 base::Lock lock_;
102 107
103 // Whether to retain profiles when the interface is not set. Remains true 108 // Whether to retain profiles when the interface is not set. Remains true
104 // until the invocation of SetParentProfileCollector(), at which point it is 109 // until the invocation of SetParentProfileCollector(), at which point it is
105 // false for the rest of the object lifetime. 110 // false for the rest of the object lifetime.
(...skipping 11 matching lines...) Expand all
117 // Profiles being cached by this object, pending a parent interface to be 122 // Profiles being cached by this object, pending a parent interface to be
118 // supplied. 123 // supplied.
119 std::vector<ProfilesState> profiles_; 124 std::vector<ProfilesState> profiles_;
120 125
121 DISALLOW_COPY_AND_ASSIGN(ChildCallStackProfileCollector); 126 DISALLOW_COPY_AND_ASSIGN(ChildCallStackProfileCollector);
122 }; 127 };
123 128
124 } // namespace metrics 129 } // namespace metrics
125 130
126 #endif // COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_ 131 #endif // COMPONENTS_METRICS_CHILD_CALL_STACK_PROFILE_COLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698