/*
 * 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";

package perfetto.protos;

message DataSourceConfig {
  message FtraceConfig {
    repeated string event_names = 1;
  }

  optional string name = 1;

  optional uint32 target_buffer = 2;

  optional FtraceConfig ftrace_config = 100;
}

message TraceConfig {
  message BufferConfig {
    optional uint32 size_kb = 1;

    enum OptimizeFor {
      DEFAULT = 0;
      ONE_SHOT_READ = 1;

    }
    optional OptimizeFor optimize_for = 3;

    enum FillPolicy {
      UNSPECIFIED = 0;
      RING_BUFFER = 1;
    }
    optional FillPolicy fill_policy = 4;
  }
  repeated BufferConfig buffers = 1;

  message DataSource {
    optional protos.DataSourceConfig config = 1;

    repeated string producer_name_filter = 2;
  }
  repeated DataSource data_sources = 2;

  optional uint32 duration_ms = 3;
}
