blob: d83a221464c221d631a2eaba1072706a0cc96e79 [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package perfetto.protos;
import "perfetto/config/android/android_log_config.proto";
import "perfetto/config/chrome/chrome_config.proto";
import "perfetto/config/ftrace/ftrace_config.proto";
import "perfetto/config/inode_file/inode_file_config.proto";
import "perfetto/config/power/android_power_config.proto";
import "perfetto/config/process_stats/process_stats_config.proto";
import "perfetto/config/profiling/heapprofd_config.proto";
import "perfetto/config/sys_stats/sys_stats_config.proto";
import "perfetto/config/test_config.proto";
// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
// to reflect changes in the corresponding C++ headers.
// The configuration that is passed to each data source when starting tracing.
message DataSourceConfig {
// Data source unique name, e.g., "linux.ftrace". This must match
// the name passed by the data source when it registers (see
// RegisterDataSource()).
optional string name = 1;
// The index of the logging buffer where TracePacket(s) will be stored.
// This field doesn't make a major difference for the Producer(s). The final
// logging buffers, in fact, are completely owned by the Service. We just ask
// the Producer to copy this number into the chunk headers it emits, so that
// the Service can quickly identify the buffer where to move the chunks into
// without expensive lookups on its fastpath.
optional uint32 target_buffer = 2;
// Set by the service to indicate the duration of the trace.
// DO NOT SET in consumer as this will be overridden by the service.
optional uint32 trace_duration_ms = 3;
// Set by the service to indicate whether this tracing session has extra
// guardrails.
// DO NOT SET in consumer as this will be overridden by the service.
optional bool enable_extra_guardrails = 6;
// Set by the service to indicate which tracing session the data source
// belongs to. The intended use case for this is checking if two data sources,
// one of which produces metadata for the other one, belong to the same trace
// session and hence should be linked together.
// This field was introduced in Aug 2018 after Android P.
optional uint64 tracing_session_id = 4;
// Keeep the lower IDs (up to 99) for fields that are *not* specific to
// data-sources and needs to be processed by the traced daemon.
optional FtraceConfig ftrace_config = 100;
optional ChromeConfig chrome_config = 101;
optional InodeFileConfig inode_file_config = 102;
optional ProcessStatsConfig process_stats_config = 103;
optional SysStatsConfig sys_stats_config = 104;
optional HeapprofdConfig heapprofd_config = 105;
optional AndroidPowerConfig android_power_config = 106;
optional AndroidLogConfig android_log_config = 107;
// This is a fallback mechanism to send a free-form text config to the
// producer. In theory this should never be needed. All the code that
// is part of the platform (i.e. traced service) is supposed to *not* truncate
// the trace config proto and propagate unknown fields. However, if anything
// in the pipeline (client or backend) ends up breaking this forward compat
// plan, this field will become the escape hatch to allow future data sources
// to get some meaningful configuration.
optional string legacy_config = 1000;
// This field is only used for testing.
optional TestConfig for_testing =
268435455; // 2^28 - 1, max field id for protos supported by Java.
}