xref: /aosp_15_r20/external/cronet/components/metrics/call_stacks/call_stack_profile_encoding.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 The Chromium Authors
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 COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_
6 #define COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_
7 
8 #include "components/metrics/call_stacks/call_stack_profile_params.h"
9 #include "third_party/metrics_proto/sampled_profile.pb.h"
10 
11 namespace metrics {
12 
13 // Translates CallStackProfileParams's process to the corresponding execution
14 // context Process.
15 Process ToExecutionContextProcess(CallStackProfileParams::Process process);
16 
17 // Translates CallStackProfileParams's thread to the corresponding
18 // SampledProfile Thread.
19 Thread ToExecutionContextThread(CallStackProfileParams::Thread thread);
20 
21 // Translates CallStackProfileParams's trigger to the corresponding
22 // SampledProfile TriggerEvent.
23 SampledProfile::TriggerEvent ToSampledProfileTriggerEvent(
24     CallStackProfileParams::Trigger trigger);
25 
26 }  // namespace metrics
27 
28 #endif  // COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_ENCODING_H_
29