Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f5b3127 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unnecessary perfetto/perfprofd messages from statsd_config proto"

parents 4d3246e6 65c72fc5
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ statsd_common_src := \
    src/metrics/MetricsManager.cpp \
    src/metrics/metrics_manager_util.cpp \
    src/packages/UidMap.cpp \
    src/perfetto/perfetto_config.proto \
    src/storage/StorageManager.cpp \
    src/StatsLogProcessor.cpp \
    src/StatsService.cpp \
@@ -73,8 +72,7 @@ statsd_common_src := \

# TODO(b/110563449): Once statsd is using a blueprint file, migrate to the proper filegroups.
statsd_common_src += \
    ../../../../system/extras/perfprofd/binder_interface/aidl/android/os/IPerfProfd.aidl \
    src/perfprofd/perfprofd_config.proto
    ../../../../system/extras/perfprofd/binder_interface/aidl/android/os/IPerfProfd.aidl

statsd_common_c_includes := \
    $(LOCAL_PATH)/src \
@@ -258,8 +256,6 @@ LOCAL_SRC_FILES := \
    src/metrics_constants/metrics_constants.proto \
    src/stats_log.proto \
    src/statsd_config.proto \
    src/perfetto/perfetto_config.proto \
    src/perfprofd/perfprofd_config.proto \
    src/atoms.proto

LOCAL_PROTOC_OPTIMIZE_TYPE := lite
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ bool CollectPerfettoTraceAndUploadToDropbox(const PerfettoDetails& config,
        return false;
    }

    std::string cfgProto = config.trace_config().SerializeAsString();
    const std::string& cfgProto = config.trace_config();
    size_t bytesWritten = fwrite(cfgProto.data(), 1, cfgProto.size(), writePipeStream);
    fclose(writePipeStream);
    if (bytesWritten != cfgProto.size() || cfgProto.size() == 0) {
+2 −11
Original line number Diff line number Diff line
@@ -55,17 +55,8 @@ bool CollectPerfprofdTraceAndUploadToDropbox(const PerfprofdDetails& config,
      return false;
    }

    // Add protobufs can't be described in AIDL, we need to re-serialize
    // the config proto to send it.
    std::vector<uint8_t> proto_serialized;
    {
      const auto& config_proto = config.perfprofd_config();
      int size = config_proto.ByteSize();
      proto_serialized.resize(size);
      ::google::protobuf::uint8* target_ptr =
          reinterpret_cast<::google::protobuf::uint8*>(proto_serialized.data());
      config_proto.SerializeWithCachedSizesToArray(target_ptr);
    }
    auto* data = reinterpret_cast<const uint8_t*>(config.perfprofd_config().data());
    std::vector<uint8_t> proto_serialized(data, data + config.perfprofd_config().size());

    // TODO: alert-id etc?

+0 −60
Original line number Diff line number Diff line
/*
 * 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;
}
+0 −1
Original line number Diff line number Diff line
../../../../../../system/extras/perfprofd/perfprofd_config.proto
 No newline at end of file
Loading