Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Caitlin Fischer | 0eedde44 | 2023-12-04 18:03:26 | [diff] [blame] | 5 | #ifndef COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_ |
| 6 | #define COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_ |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 7 | |
Jason Chase | 5ec7e7fc | 2024-09-26 02:38:49 | [diff] [blame] | 8 | #include "components/sampling_profiler/call_stack_profile_params.h" |
| 9 | #include "components/sampling_profiler/process_type.h" |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 10 | #include "third_party/metrics_proto/sampled_profile.pb.h" |
| 11 | |
| 12 | namespace metrics { |
| 13 | |
| 14 | // Translates CallStackProfileParams's process to the corresponding execution |
| 15 | // context Process. |
Jason Chase | 5ec7e7fc | 2024-09-26 02:38:49 | [diff] [blame] | 16 | Process ToExecutionContextProcess( |
| 17 | sampling_profiler::ProfilerProcessType process); |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 18 | |
| 19 | // Translates CallStackProfileParams's thread to the corresponding |
| 20 | // SampledProfile Thread. |
Jason Chase | 5ec7e7fc | 2024-09-26 02:38:49 | [diff] [blame] | 21 | Thread ToExecutionContextThread(sampling_profiler::ProfilerThreadType thread); |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 22 | |
| 23 | // Translates CallStackProfileParams's trigger to the corresponding |
| 24 | // SampledProfile TriggerEvent. |
| 25 | SampledProfile::TriggerEvent ToSampledProfileTriggerEvent( |
Jason Chase | 5ec7e7fc | 2024-09-26 02:38:49 | [diff] [blame] | 26 | sampling_profiler::CallStackProfileParams::Trigger trigger); |
Xi Cheng | 74c06d86 | 2018-08-16 01:06:48 | [diff] [blame] | 27 | |
| 28 | } // namespace metrics |
| 29 | |
Caitlin Fischer | 0eedde44 | 2023-12-04 18:03:26 | [diff] [blame] | 30 | #endif // COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_ |