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

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

Issue 2444143002: Add process lifetime annotations to stack samples. (Closed)
Patch Set: abandon generator for on-the-fly Profiles creation Created 4 years 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 COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/profiler/stack_sampling_profiler.h" 12 #include "base/profiler/stack_sampling_profiler.h"
13 #include "components/metrics/call_stack_profile_params.h" 13 #include "components/metrics/call_stack_profile_params.h"
14 #include "components/metrics/metrics_provider.h" 14 #include "components/metrics/metrics_provider.h"
15 15
16 namespace metrics { 16 namespace metrics {
17 class ChromeUserMetricsExtension; 17 class ChromeUserMetricsExtension;
18 18
19 // Performs metrics logging for the stack sampling profiler. 19 // Performs metrics logging for the stack sampling profiler.
20 class CallStackProfileMetricsProvider : public MetricsProvider { 20 class CallStackProfileMetricsProvider : public MetricsProvider {
21 public: 21 public:
22 // These phases of a process lifetime can be passed as process "phases" to
23 // StackSmaplingProfile::SetProcessPhase(). Be sure to update the translation
24 // constants at the top of the .cc file when this is changed.
25 enum Phases : int {
26 MAIN_LOOP_START,
27 MAIN_NAVIGATION_START,
28 MAIN_NAVIGATION_FINISHED,
29 FIRST_NONEMPTY_PAINT,
30
31 SHUTDOWN_START,
32
33 PHASES_MAX_VALUE
34 };
35
22 CallStackProfileMetricsProvider(); 36 CallStackProfileMetricsProvider();
23 ~CallStackProfileMetricsProvider() override; 37 ~CallStackProfileMetricsProvider() override;
24 38
25 // Get a callback for use with StackSamplingProfiler that provides completed 39 // Get a callback for use with StackSamplingProfiler that provides completed
26 // profiles to this object. The callback should be immediately passed to the 40 // profiles to this object. The callback should be immediately passed to the
27 // StackSamplingProfiler, and should not be reused between 41 // StackSamplingProfiler, and should not be reused between
28 // StackSamplingProfilers. This function may be called on any thread. 42 // StackSamplingProfilers. This function may be called on any thread.
29 static base::StackSamplingProfiler::CompletedCallback GetProfilerCallback( 43 static base::StackSamplingProfiler::CompletedCallback GetProfilerCallback(
30 const CallStackProfileParams& params); 44 const CallStackProfileParams& params);
31 45
(...skipping 24 matching lines...) Expand all
56 // Returns true if reporting of profiles is enabled according to the 70 // Returns true if reporting of profiles is enabled according to the
57 // controlling Finch field trial. 71 // controlling Finch field trial.
58 static bool IsReportingEnabledByFieldTrial(); 72 static bool IsReportingEnabledByFieldTrial();
59 73
60 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); 74 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider);
61 }; 75 };
62 76
63 } // namespace metrics 77 } // namespace metrics
64 78
65 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ 79 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | components/metrics/call_stack_profile_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698