• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2017 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
17syntax = "proto2";
18option optimize_for = LITE_RUNTIME;
19
20package perfetto.protos;
21
22import "perfetto/config/android/android_log_config.proto";
23import "perfetto/config/android/packages_list_config.proto";
24import "perfetto/config/chrome/chrome_config.proto";
25import "perfetto/config/ftrace/ftrace_config.proto";
26import "perfetto/config/inode_file/inode_file_config.proto";
27import "perfetto/config/power/android_power_config.proto";
28import "perfetto/config/process_stats/process_stats_config.proto";
29import "perfetto/config/profiling/heapprofd_config.proto";
30import "perfetto/config/sys_stats/sys_stats_config.proto";
31import "perfetto/config/test_config.proto";
32
33// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
34// to reflect changes in the corresponding C++ headers.
35
36// The configuration that is passed to each data source when starting tracing.
37message DataSourceConfig {
38  // Data source unique name, e.g., "linux.ftrace". This must match
39  // the name passed by the data source when it registers (see
40  // RegisterDataSource()).
41  optional string name = 1;
42
43  // The index of the logging buffer where TracePacket(s) will be stored.
44  // This field doesn't make a major difference for the Producer(s). The final
45  // logging buffers, in fact, are completely owned by the Service. We just ask
46  // the Producer to copy this number into the chunk headers it emits, so that
47  // the Service can quickly identify the buffer where to move the chunks into
48  // without expensive lookups on its fastpath.
49  optional uint32 target_buffer = 2;
50
51  // Set by the service to indicate the duration of the trace.
52  // DO NOT SET in consumer as this will be overridden by the service.
53  optional uint32 trace_duration_ms = 3;
54
55  // Set by the service to indicate whether this tracing session has extra
56  // guardrails.
57  // DO NOT SET in consumer as this will be overridden by the service.
58  optional bool enable_extra_guardrails = 6;
59
60  // Set by the service to indicate which tracing session the data source
61  // belongs to. The intended use case for this is checking if two data sources,
62  // one of which produces metadata for the other one, belong to the same trace
63  // session and hence should be linked together.
64  // This field was introduced in Aug 2018 after Android P.
65  optional uint64 tracing_session_id = 4;
66
67  // Keeep the lower IDs (up to 99) for fields that are *not* specific to
68  // data-sources and needs to be processed by the traced daemon.
69
70  optional FtraceConfig ftrace_config = 100;
71  optional ChromeConfig chrome_config = 101;
72  optional InodeFileConfig inode_file_config = 102;
73  optional ProcessStatsConfig process_stats_config = 103;
74  optional SysStatsConfig sys_stats_config = 104;
75  optional HeapprofdConfig heapprofd_config = 105;
76  optional AndroidPowerConfig android_power_config = 106;
77  optional AndroidLogConfig android_log_config = 107;
78  optional PackagesListConfig packages_list_config = 109;
79
80  // This is a fallback mechanism to send a free-form text config to the
81  // producer. In theory this should never be needed. All the code that
82  // is part of the platform (i.e. traced service) is supposed to *not* truncate
83  // the trace config proto and propagate unknown fields. However, if anything
84  // in the pipeline (client or backend) ends up breaking this forward compat
85  // plan, this field will become the escape hatch to allow future data sources
86  // to get some meaningful configuration.
87  optional string legacy_config = 1000;
88
89  // This field is only used for testing.
90  optional TestConfig for_testing =
91      268435455;  // 2^28 - 1, max field id for protos supported by Java.
92}
93