• 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/chrome/chrome_config.proto";
23import "perfetto/config/ftrace/ftrace_config.proto";
24import "perfetto/config/inode_file/inode_file_config.proto";
25import "perfetto/config/process_stats/process_stats_config.proto";
26import "perfetto/config/test_config.proto";
27// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
28// to reflect changes in the corresponding C++ headers.
29
30// The configuration that is passed to each data source when starting tracing.
31message DataSourceConfig {
32  // Data source unique name, e.g., "org.chromium.trace_events". This must match
33  // the name passed by the data source when it registers (see
34  // RegisterDataSource()).
35  optional string name = 1;
36
37  // The index of the logging buffer where TracePacket(s) will be stored.
38  // This field doesn't make a major difference for the Producer(s). The final
39  // logging buffers, in fact, are completely owned by the Service. We just ask
40  // the Producer to copy this number into the chunk headers it emits, so that
41  // the Service can quickly identify the buffer where to move the chunks into
42  // without expensive lookups on its fastpath.
43  optional uint32 target_buffer = 2;
44
45  // Gets set by the service to indicate the duration of the trace.
46  // DO NOT SET in consumer as this will be overridden by the service.
47  optional uint32 trace_duration_ms = 3;
48
49  // Keeep the lower IDs (up to 99) for fields that are *not* specific to
50  // data-sources and needs to be processed by the traced daemon.
51
52  optional FtraceConfig ftrace_config = 100;
53  optional ChromeConfig chrome_config = 101;
54  optional InodeFileConfig inode_file_config = 102;
55  optional ProcessStatsConfig process_stats_config = 103;
56
57  // This is a fallback mechanism to send a free-form text config to the
58  // producer. In theory this should never be needed. All the code that
59  // is part of the platform (i.e. traced service) is supposed to *not* truncate
60  // the trace config proto and propagate unknown fields. However, if anything
61  // in the pipeline (client or backend) ends up breaking this forward compat
62  // plan, this field will become the escape hatch to allow future data sources
63  // to get some meaningful configuration.
64  optional string legacy_config = 1000;
65
66  // This field is only used for testing.
67  optional TestConfig for_testing =
68      536870911;  // 2^29 - 1, max field id for protos.
69}
70