Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_PROFILED_STACK_STATE_H_ | |
| 6 #define CONTENT_COMMON_PROFILED_STACK_STATE_H_ | |
| 7 | |
| 8 #include "base/profiler/stack_sampling_profiler.h" | |
| 9 #include "base/time/time.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 // Profiled stacks and related metrics provider parameters | |
| 15 // to send to UMA. Duplicated Trigger enum for IPC usage. | |
| 16 struct CONTENT_EXPORT ProfiledStackState { | |
| 17 // This enum should be kept in sync with | |
| 18 // components/metrics/call_stack_profile_metrics_provider.h | |
| 19 enum Trigger { | |
| 20 UNKNOWN, | |
| 21 PROCESS_STARTUP, | |
| 22 JANKY_TASK, | |
| 23 THREAD_HUNG, | |
| 24 TRIGGER_LAST = THREAD_HUNG | |
| 25 }; | |
| 26 | |
| 27 ProfiledStackState( | |
| 28 Trigger trigger, | |
| 29 bool preserve_sample_ordering, | |
| 30 base::TimeTicks start_timestamp, | |
| 31 const base::StackSamplingProfiler::CallStackProfiles& profiles); | |
| 32 | |
| 33 // Default constructor and exposed to satisfy IPC macros. | |
|
Mike Wittman
2015/09/03 18:16:36
nit: is exposed
sydli
2015/09/09 17:08:45
Done.
| |
| 34 // Do not use explicitly. | |
| 35 ProfiledStackState(); | |
|
robliao
2015/09/03 22:25:59
You can make this private with a friend class, but
sydli
2015/09/09 17:08:45
Thanks for looking into this!
| |
| 36 | |
| 37 ~ProfiledStackState(); | |
| 38 | |
| 39 // The triggering event. | |
| 40 Trigger trigger; | |
| 41 | |
| 42 // True if sample ordering is important and should be preserved when the | |
| 43 // associated profiles are compressed. | |
| 44 bool preserve_sample_ordering; | |
| 45 | |
| 46 // Time of profiling start. | |
| 47 base::TimeTicks start_timestamp; | |
| 48 | |
| 49 // Collected stack profiles. | |
| 50 base::StackSamplingProfiler::CallStackProfiles profiles; | |
| 51 }; | |
| 52 | |
| 53 } // namespace content | |
| 54 | |
| 55 #endif // CONTENT_COMMON_PROFILED_STACK_STATE_H_ | |
| OLD | NEW |