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

Unified Diff: base/profiler/native_stack_sampler.h

Issue 2444143002: Add process lifetime annotations to stack samples. (Closed)
Patch Set: abandon generator for on-the-fly Profiles creation Created 4 years, 1 month 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_posix.cc » ('j') | no next file with comments »
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 c7ef84ae31ca8033a09146a1ecb19a831daa4744..8d7e441b69306b072ed67321a531ac76aee4e28c 100644
--- a/base/profiler/native_stack_sampler.h
+++ b/base/profiler/native_stack_sampler.h
@@ -21,12 +21,22 @@ class NativeStackSamplerTestDelegate;
// given thread.
class NativeStackSampler {
public:
+ // 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
+ // completely predictable and do nothing that could acquire a mutex; a
+ // Callback object is code outside the control of this object and could,
+ // for example, acquire a mutex as part of allocating memory for a LOG
+ // message.
+ using AnnotateCallback = void (*)(StackSamplingProfiler::Sample*);
+
virtual ~NativeStackSampler();
// Creates a stack sampler that records samples for |thread_handle|. Returns
// null if this platform does not support stack sampling.
static std::unique_ptr<NativeStackSampler> Create(
PlatformThreadId thread_id,
+ AnnotateCallback annotator,
NativeStackSamplerTestDelegate* test_delegate);
// The following functions are all called on the SamplingThread (not the
« no previous file with comments | « no previous file | base/profiler/native_stack_sampler_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698