| // Copyright 2016 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. |
| |
| module metrics.mojom; |
| |
| import "mojo/public/mojom/base/file_path.mojom"; |
| import "mojo/public/mojom/base/time.mojom"; |
| |
| // These structs mirror the corresponding types in base::StackSamplingProfiler. |
| |
| struct CallStackModule { |
| uint64 base_address; |
| string id; |
| mojo_base.mojom.FilePath filename; |
| }; |
| |
| struct CallStackFrame { |
| uint64 instruction_pointer; |
| uint64 module_index; |
| }; |
| |
| struct CallStackSample { |
| array<CallStackFrame> frames; |
| uint32 process_milestones; |
| }; |
| |
| struct CallStackProfile { |
| array<CallStackModule> modules; |
| array<CallStackSample> samples; |
| mojo_base.mojom.TimeDelta profile_duration; |
| mojo_base.mojom.TimeDelta sampling_period; |
| }; |
| |
| enum Process { |
| UNKNOWN_PROCESS, |
| BROWSER_PROCESS, |
| RENDERER_PROCESS, |
| GPU_PROCESS, |
| UTILITY_PROCESS, |
| ZYGOTE_PROCESS, |
| SANDBOX_HELPER_PROCESS, |
| PPAPI_PLUGIN_PROCESS, |
| PPAPI_BROKER_PROCESS, |
| }; |
| |
| enum Thread { |
| UNKNOWN_THREAD, |
| MAIN_THREAD, |
| IO_THREAD, |
| COMPOSITOR_THREAD, |
| }; |
| |
| enum Trigger { |
| UNKNOWN, |
| PROCESS_STARTUP, |
| JANKY_TASK, |
| THREAD_HUNG, |
| PERIODIC_COLLECTION, |
| }; |
| |
| enum SampleOrderingSpec { |
| MAY_SHUFFLE, |
| PRESERVE_ORDER, |
| }; |
| |
| struct CallStackProfileParams { |
| Process process; |
| Thread thread; |
| Trigger trigger; |
| SampleOrderingSpec ordering_spec; |
| }; |
| |
| interface CallStackProfileCollector { |
| Collect(CallStackProfileParams params, |
| mojo_base.mojom.TimeTicks start_timestamp, |
| CallStackProfile profile); |
| }; |