1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
18 #define INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
19 
20 #include <stddef.h>
21 #include <stdint.h>
22 
23 namespace perfetto {
24 namespace internal {
25 
26 // A static_assert in tracing_muxer_impl.cc guarantees that this stays in sync
27 // with the definition in tracing/core/basic_types.h
28 using BufferId = uint16_t;
29 
30 // This is a direct index in the TracingMuxer::backends_ vector.
31 // Backends are only added and never removed.
32 using TracingBackendId = size_t;
33 
34 // Max numbers of data sources that can be registered in a process.
35 constexpr size_t kMaxDataSources = 32;
36 
37 // Max instances for each data source type. This typically matches the
38 // "max number of concurrent tracing sessions". However remember that a data
39 // source can be instantiated more than once within one tracing session by
40 // creating two entries for it in the trace config.
41 constexpr size_t kMaxDataSourceInstances = 8;
42 
43 }  // namespace internal
44 }  // namespace perfetto
45 
46 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
47