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

Side by Side Diff: components/metrics/call_stack_profile_params.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_CALL_STACK_PROFILE_PARAMS_H_ 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
7 7
8 #include "base/time/time.h"
9
8 namespace metrics { 10 namespace metrics {
9 11
10 // Parameters to pass back to the metrics provider. 12 // Parameters to pass back to the metrics provider.
11 struct CallStackProfileParams { 13 struct CallStackProfileParams {
12 // The process in which the collection occurred. 14 // The process in which the collection occurred.
13 enum Process { 15 enum Process {
14 UNKNOWN_PROCESS, 16 UNKNOWN_PROCESS,
15 BROWSER_PROCESS, 17 BROWSER_PROCESS,
16 RENDERER_PROCESS, 18 RENDERER_PROCESS,
17 GPU_PROCESS, 19 GPU_PROCESS,
(...skipping 24 matching lines...) Expand all
42 RENDER_THREAD, 44 RENDER_THREAD,
43 UTILITY_THREAD 45 UTILITY_THREAD
44 }; 46 };
45 47
46 // The event that triggered the profile collection. 48 // The event that triggered the profile collection.
47 enum Trigger { 49 enum Trigger {
48 UNKNOWN, 50 UNKNOWN,
49 PROCESS_STARTUP, 51 PROCESS_STARTUP,
50 JANKY_TASK, 52 JANKY_TASK,
51 THREAD_HUNG, 53 THREAD_HUNG,
52 TRIGGER_LAST = THREAD_HUNG 54 PERIODIC_COLLECTION,
55 TRIGGER_LAST = PERIODIC_COLLECTION
53 }; 56 };
54 57
55 // Allows the caller to specify whether sample ordering is 58 // Allows the caller to specify whether sample ordering is
56 // important. MAY_SHUFFLE should always be used to enable better compression, 59 // important. MAY_SHUFFLE should always be used to enable better compression,
57 // unless the use case needs order to be preserved for a specific reason. 60 // unless the use case needs order to be preserved for a specific reason.
58 enum SampleOrderingSpec { 61 enum SampleOrderingSpec {
59 // The provider may shuffle the sample order to improve compression. 62 // The provider may shuffle the sample order to improve compression.
60 MAY_SHUFFLE, 63 MAY_SHUFFLE,
61 // The provider will not change the sample order. 64 // The provider will not change the sample order.
62 PRESERVE_ORDER 65 PRESERVE_ORDER
(...skipping 10 matching lines...) Expand all
73 Process process; 76 Process process;
74 77
75 // The collection thread. 78 // The collection thread.
76 Thread thread; 79 Thread thread;
77 80
78 // The triggering event. 81 // The triggering event.
79 Trigger trigger; 82 Trigger trigger;
80 83
81 // Whether to preserve sample ordering. 84 // Whether to preserve sample ordering.
82 SampleOrderingSpec ordering_spec; 85 SampleOrderingSpec ordering_spec;
86
87 // The time at which the CallStackProfileMetricsProvider became aware of the
88 // request for profiling. In particular, this is when callback was requested
89 // via CallStackProfileMetricsProvider::GetProfilerCallback(). Used to
90 // determine if collection was disabled during the collection of the profile.
91 base::TimeTicks start_timestamp;
Mike Wittman 2017/07/01 02:44:06 Do we need to move this from a callback param to i
83 }; 92 };
84 93
85 } // namespace metrics 94 } // namespace metrics
86 95
87 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ 96 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698