/* * 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. */ /******************************************************************************* * AUTOGENERATED - DO NOT EDIT ******************************************************************************* * This file has been generated from the protobuf message * perfetto/config/data_source_config.proto * by * ../../tools/proto_to_cpp/proto_to_cpp.cc. * If you need to make changes here, change the .proto file and then run * ./tools/gen_tracing_cpp_headers_from_protos */ #include "perfetto/tracing/core/data_source_config.h" #include "perfetto/config/android/android_log_config.pb.h" #include "perfetto/config/android/packages_list_config.pb.h" #include "perfetto/config/chrome/chrome_config.pb.h" #include "perfetto/config/data_source_config.pb.h" #include "perfetto/config/ftrace/ftrace_config.pb.h" #include "perfetto/config/inode_file/inode_file_config.pb.h" #include "perfetto/config/power/android_power_config.pb.h" #include "perfetto/config/process_stats/process_stats_config.pb.h" #include "perfetto/config/profiling/heapprofd_config.pb.h" #include "perfetto/config/sys_stats/sys_stats_config.pb.h" #include "perfetto/config/test_config.pb.h" namespace perfetto { DataSourceConfig::DataSourceConfig() = default; DataSourceConfig::~DataSourceConfig() = default; DataSourceConfig::DataSourceConfig(const DataSourceConfig&) = default; DataSourceConfig& DataSourceConfig::operator=(const DataSourceConfig&) = default; DataSourceConfig::DataSourceConfig(DataSourceConfig&&) noexcept = default; DataSourceConfig& DataSourceConfig::operator=(DataSourceConfig&&) = default; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" bool DataSourceConfig::operator==(const DataSourceConfig& other) const { return (name_ == other.name_) && (target_buffer_ == other.target_buffer_) && (trace_duration_ms_ == other.trace_duration_ms_) && (enable_extra_guardrails_ == other.enable_extra_guardrails_) && (tracing_session_id_ == other.tracing_session_id_) && (ftrace_config_ == other.ftrace_config_) && (chrome_config_ == other.chrome_config_) && (inode_file_config_ == other.inode_file_config_) && (process_stats_config_ == other.process_stats_config_) && (sys_stats_config_ == other.sys_stats_config_) && (heapprofd_config_ == other.heapprofd_config_) && (android_power_config_ == other.android_power_config_) && (android_log_config_ == other.android_log_config_) && (packages_list_config_ == other.packages_list_config_) && (legacy_config_ == other.legacy_config_) && (for_testing_ == other.for_testing_); } #pragma GCC diagnostic pop void DataSourceConfig::FromProto( const perfetto::protos::DataSourceConfig& proto) { static_assert(sizeof(name_) == sizeof(proto.name()), "size mismatch"); name_ = static_cast(proto.name()); static_assert(sizeof(target_buffer_) == sizeof(proto.target_buffer()), "size mismatch"); target_buffer_ = static_cast(proto.target_buffer()); static_assert(sizeof(trace_duration_ms_) == sizeof(proto.trace_duration_ms()), "size mismatch"); trace_duration_ms_ = static_cast(proto.trace_duration_ms()); static_assert(sizeof(enable_extra_guardrails_) == sizeof(proto.enable_extra_guardrails()), "size mismatch"); enable_extra_guardrails_ = static_cast( proto.enable_extra_guardrails()); static_assert( sizeof(tracing_session_id_) == sizeof(proto.tracing_session_id()), "size mismatch"); tracing_session_id_ = static_cast(proto.tracing_session_id()); ftrace_config_.FromProto(proto.ftrace_config()); chrome_config_.FromProto(proto.chrome_config()); inode_file_config_.FromProto(proto.inode_file_config()); process_stats_config_.FromProto(proto.process_stats_config()); sys_stats_config_.FromProto(proto.sys_stats_config()); heapprofd_config_.FromProto(proto.heapprofd_config()); android_power_config_.FromProto(proto.android_power_config()); android_log_config_.FromProto(proto.android_log_config()); packages_list_config_.FromProto(proto.packages_list_config()); static_assert(sizeof(legacy_config_) == sizeof(proto.legacy_config()), "size mismatch"); legacy_config_ = static_cast(proto.legacy_config()); for_testing_.FromProto(proto.for_testing()); unknown_fields_ = proto.unknown_fields(); } void DataSourceConfig::ToProto( perfetto::protos::DataSourceConfig* proto) const { proto->Clear(); static_assert(sizeof(name_) == sizeof(proto->name()), "size mismatch"); proto->set_name(static_castname())>(name_)); static_assert(sizeof(target_buffer_) == sizeof(proto->target_buffer()), "size mismatch"); proto->set_target_buffer( static_casttarget_buffer())>(target_buffer_)); static_assert( sizeof(trace_duration_ms_) == sizeof(proto->trace_duration_ms()), "size mismatch"); proto->set_trace_duration_ms( static_casttrace_duration_ms())>(trace_duration_ms_)); static_assert(sizeof(enable_extra_guardrails_) == sizeof(proto->enable_extra_guardrails()), "size mismatch"); proto->set_enable_extra_guardrails( static_castenable_extra_guardrails())>( enable_extra_guardrails_)); static_assert( sizeof(tracing_session_id_) == sizeof(proto->tracing_session_id()), "size mismatch"); proto->set_tracing_session_id( static_casttracing_session_id())>(tracing_session_id_)); ftrace_config_.ToProto(proto->mutable_ftrace_config()); chrome_config_.ToProto(proto->mutable_chrome_config()); inode_file_config_.ToProto(proto->mutable_inode_file_config()); process_stats_config_.ToProto(proto->mutable_process_stats_config()); sys_stats_config_.ToProto(proto->mutable_sys_stats_config()); heapprofd_config_.ToProto(proto->mutable_heapprofd_config()); android_power_config_.ToProto(proto->mutable_android_power_config()); android_log_config_.ToProto(proto->mutable_android_log_config()); packages_list_config_.ToProto(proto->mutable_packages_list_config()); static_assert(sizeof(legacy_config_) == sizeof(proto->legacy_config()), "size mismatch"); proto->set_legacy_config( static_castlegacy_config())>(legacy_config_)); for_testing_.ToProto(proto->mutable_for_testing()); *(proto->mutable_unknown_fields()) = unknown_fields_; } } // namespace perfetto