/*
 * Copyright (C) 2019 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;

// Data source that lists details (such as version code) about packages on an
// Android device.
message PackagesListConfig {
  // If not empty, emit info about only the following list of package names
  // (exact match, no regex). Can be combined with
  // |package_name_regex_filter|: a package is included if it matches either
  // filter. If both filters are empty, emit info about all packages.
  repeated string package_name_filter = 1;

  // If not empty, emit info about only the packages whose names match any of
  // the following regexes (full match, not partial). Can be combined with
  // |package_name_filter|: a package is included if it matches either filter.
  // If both filters are empty, emit info about all packages.
  // This field was introduced in Android 26Q2 (Perfetto v55).
  repeated string package_name_regex_filter = 3;

  // If present and non-zero, the data source will periodically poll for CPU
  // use by packages and only emit results for those that it sees. If absent,
  // the data source will emit results for all packages at startup. The package
  // name filters apply either way.
  optional uint32 only_write_on_cpu_use_every_ms = 2;
}
