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

Side by Side Diff: base/profiler/native_stack_sampler.h

Issue 2444143002: Add process lifetime annotations to stack samples. (Closed)
Patch Set: addressed review comments by wittman 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 5 #ifndef BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
6 #define BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 6 #define BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/profiler/stack_sampling_profiler.h" 12 #include "base/profiler/stack_sampling_profiler.h"
13 #include "base/threading/platform_thread.h" 13 #include "base/threading/platform_thread.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 class NativeStackSamplerTestDelegate; 17 class NativeStackSamplerTestDelegate;
18 18
19 // NativeStackSampler is an implementation detail of StackSamplingProfiler. It 19 // NativeStackSampler is an implementation detail of StackSamplingProfiler. It
20 // abstracts the native implementation required to record a stack sample for a 20 // abstracts the native implementation required to record a stack sample for a
21 // given thread. 21 // given thread.
22 class NativeStackSampler { 22 class NativeStackSampler {
23 public: 23 public:
24 virtual ~NativeStackSampler(); 24 virtual ~NativeStackSampler();
25 25
26 // Creates a stack sampler that records samples for |thread_handle|. Returns 26 // Creates a stack sampler that records samples for |thread_handle|. Returns
27 // null if this platform does not support stack sampling. 27 // null if this platform does not support stack sampling.
28 static std::unique_ptr<NativeStackSampler> Create( 28 static std::unique_ptr<NativeStackSampler> Create(
29 PlatformThreadId thread_id, 29 PlatformThreadId thread_id,
30 StackSamplingProfiler::AnnotateCallback annotator,
30 NativeStackSamplerTestDelegate* test_delegate); 31 NativeStackSamplerTestDelegate* test_delegate);
31 32
32 // The following functions are all called on the SamplingThread (not the 33 // The following functions are all called on the SamplingThread (not the
33 // thread being sampled). 34 // thread being sampled).
34 35
35 // Notifies the sampler that we're starting to record a new profile. Modules 36 // Notifies the sampler that we're starting to record a new profile. Modules
36 // shared across samples in the profile should be recorded in |modules|. 37 // shared across samples in the profile should be recorded in |modules|.
37 virtual void ProfileRecordingStarting( 38 virtual void ProfileRecordingStarting(
38 std::vector<StackSamplingProfiler::Module>* modules) = 0; 39 std::vector<StackSamplingProfiler::Module>* modules) = 0;
39 40
(...skipping 25 matching lines...) Expand all
65 NativeStackSamplerTestDelegate(); 66 NativeStackSamplerTestDelegate();
66 67
67 private: 68 private:
68 DISALLOW_COPY_AND_ASSIGN(NativeStackSamplerTestDelegate); 69 DISALLOW_COPY_AND_ASSIGN(NativeStackSamplerTestDelegate);
69 }; 70 };
70 71
71 } // namespace base 72 } // namespace base
72 73
73 #endif // BASE_PROFILER_NATIVE_STACK_SAMPLER_H_ 74 #endif // BASE_PROFILER_NATIVE_STACK_SAMPLER_H_
74 75
OLDNEW
« no previous file with comments | « no previous file | base/profiler/native_stack_sampler_posix.cc » ('j') | base/profiler/native_stack_sampler_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698