Chromium Code Reviews| Index: base/metrics/call_stack_profile_params.h |
| diff --git a/base/metrics/call_stack_profile_params.h b/base/metrics/call_stack_profile_params.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..09098828dc5ff4cd571ead9a023246c0cae20da6 |
| --- /dev/null |
| +++ b/base/metrics/call_stack_profile_params.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |
| +#define BASE_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |
| + |
| +#include <string> |
|
Mike Wittman
2015/08/31 19:35:57
All these headers are unused, except for base/base
sydli
2015/08/31 20:09:42
Done.
|
| +#include <vector> |
| + |
| +#include "base/base_export.h" |
| +#include "base/profiler/stack_sampling_profiler.h" |
| +#include "base/time/time.h" |
| + |
| +namespace base { |
| + |
| +// Stack profiling parameters for metrics collection. |
| +struct BASE_EXPORT CallStackProfileParams { |
| + enum Trigger { |
| + UNKNOWN, |
| + PROCESS_STARTUP, |
| + JANKY_TASK, |
| + THREAD_HUNG, |
| + TRIGGER_LAST = THREAD_HUNG |
| + }; |
| + |
| + // Default constructor to satisfy IPC macros. |
| + CallStackProfileParams(); |
|
Mike Wittman
2015/08/31 19:35:57
Is it possible to make this private, and friend th
sydli
2015/08/31 20:09:42
Not sure which IPC class uses this -- I'll update
|
| + |
| + // If unspecified, sets |preserve_sample_ordering| to false. |
| + explicit CallStackProfileParams(Trigger trigger); |
| + CallStackProfileParams(Trigger trigger, bool preserve_sample_ordering); |
| + |
| + // The triggering event. |
| + Trigger trigger; |
| + |
| + // True if sample ordering is important and should be preserved when the |
| + // associated profiles are compressed. This should only be set to true if |
| + // the intended use of the requires that the sequence of call stacks within |
| + // a particular profile be preserved. The default value of false provides |
| + // better compression of the encoded profile and is sufficient for the |
| + // typical use case of recording profiles for stack frequency analysis in |
| + // aggregate. |
| + bool preserve_sample_ordering; |
| +}; |
| + |
| +} // namespace base |
| + |
| +#endif // BASE_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |