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

Unified Diff: base/profiler/native_stack_sampler.h

Issue 2554123002: Support parallel captures from the StackSamplingProfiler. (Closed)
Patch Set: merged synchronized-stop CL Created 3 years, 10 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/native_stack_sampler_win.cc » ('j') | base/profiler/stack_sampling_profiler.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler/native_stack_sampler.h
diff --git a/base/profiler/native_stack_sampler.h b/base/profiler/native_stack_sampler.h
index 8d7e441b69306b072ed67321a531ac76aee4e28c..b958894dbe95e2986a1f456046b5ba45b4ec27a8 100644
--- a/base/profiler/native_stack_sampler.h
+++ b/base/profiler/native_stack_sampler.h
@@ -21,6 +21,17 @@ class NativeStackSamplerTestDelegate;
// given thread.
class NativeStackSampler {
public:
+ // The thread state as determined by the sampler during it's last attempt.
Mike Wittman 2017/02/13 22:35:57 All changes in this file and native_stack_sampler_
bcwhite 2017/02/14 14:33:01 Done.
+ enum ThreadState {
+ THREAD_UNCHECKED,
+ THREAD_RUNNING,
+ THREAD_EXITED,
+ THREAD_UNSUSPENDABLE,
+ THREAD_NO_INFO,
+ THREAD_STACK_TOO_BIG,
+ THREAD_INACCESSIBLE,
+ };
+
// The callback type used to add annotations to a sample during collection.
// This is passed to the native sampler to be applied at the most appropriate
// time. It is a simple function-pointer because the generated code must be
@@ -54,10 +65,17 @@ class NativeStackSampler {
// profile.
virtual void ProfileRecordingStopped() = 0;
+ // Gets the last-known thread state.
+ ThreadState thread_state() { return thread_state_; }
+
protected:
NativeStackSampler();
+ void set_thread_state(ThreadState state) { thread_state_ = state; }
+
private:
+ ThreadState thread_state_ = THREAD_UNCHECKED;
+
DISALLOW_COPY_AND_ASSIGN(NativeStackSampler);
};
@@ -69,7 +87,10 @@ class BASE_EXPORT NativeStackSamplerTestDelegate {
// Called after copying the stack and resuming the target thread, but prior to
// walking the stack. Invoked on the SamplingThread.
- virtual void OnPreStackWalk() = 0;
+ virtual void OnPreStackWalk(){};
+
+ // Called after the sampling is complete.
+ virtual void OnPostRecordSample(NativeStackSampler::ThreadState state){};
protected:
NativeStackSamplerTestDelegate();
« no previous file with comments | « no previous file | base/profiler/native_stack_sampler_win.cc » ('j') | base/profiler/stack_sampling_profiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698