| /* |
| * 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 |
| * protos/perfetto/config/profiling/java_hprof_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 "src/profiling/memory/java_hprof_config.h" |
| |
| #include "protos/perfetto/config/profiling/java_hprof_config.pb.h" |
| |
| namespace perfetto { |
| |
| JavaHprofConfig::JavaHprofConfig() = default; |
| JavaHprofConfig::~JavaHprofConfig() = default; |
| JavaHprofConfig::JavaHprofConfig(const JavaHprofConfig&) = default; |
| JavaHprofConfig& JavaHprofConfig::operator=(const JavaHprofConfig&) = default; |
| JavaHprofConfig::JavaHprofConfig(JavaHprofConfig&&) noexcept = default; |
| JavaHprofConfig& JavaHprofConfig::operator=(JavaHprofConfig&&) = default; |
| |
| #pragma GCC diagnostic push |
| #pragma GCC diagnostic ignored "-Wfloat-equal" |
| bool JavaHprofConfig::operator==(const JavaHprofConfig& other) const { |
| return (process_cmdline_ == other.process_cmdline_) && (pid_ == other.pid_) && |
| (continuous_dump_config_ == other.continuous_dump_config_); |
| } |
| #pragma GCC diagnostic pop |
| |
| void JavaHprofConfig::ParseRawProto(const std::string& raw) { |
| perfetto::protos::JavaHprofConfig proto; |
| proto.ParseFromString(raw); |
| FromProto(proto); |
| } |
| |
| void JavaHprofConfig::FromProto( |
| const perfetto::protos::JavaHprofConfig& proto) { |
| process_cmdline_.clear(); |
| for (const auto& field : proto.process_cmdline()) { |
| process_cmdline_.emplace_back(); |
| static_assert( |
| sizeof(process_cmdline_.back()) == sizeof(proto.process_cmdline(0)), |
| "size mismatch"); |
| process_cmdline_.back() = |
| static_cast<decltype(process_cmdline_)::value_type>(field); |
| } |
| |
| pid_.clear(); |
| for (const auto& field : proto.pid()) { |
| pid_.emplace_back(); |
| static_assert(sizeof(pid_.back()) == sizeof(proto.pid(0)), "size mismatch"); |
| pid_.back() = static_cast<decltype(pid_)::value_type>(field); |
| } |
| |
| continuous_dump_config_->FromProto(proto.continuous_dump_config()); |
| unknown_fields_ = proto.unknown_fields(); |
| } |
| |
| void JavaHprofConfig::ToProto(perfetto::protos::JavaHprofConfig* proto) const { |
| proto->Clear(); |
| |
| for (const auto& it : process_cmdline_) { |
| proto->add_process_cmdline( |
| static_cast<decltype(proto->process_cmdline(0))>(it)); |
| static_assert(sizeof(it) == sizeof(proto->process_cmdline(0)), |
| "size mismatch"); |
| } |
| |
| for (const auto& it : pid_) { |
| proto->add_pid(static_cast<decltype(proto->pid(0))>(it)); |
| static_assert(sizeof(it) == sizeof(proto->pid(0)), "size mismatch"); |
| } |
| |
| continuous_dump_config_->ToProto(proto->mutable_continuous_dump_config()); |
| *(proto->mutable_unknown_fields()) = unknown_fields_; |
| } |
| |
| JavaHprofConfig::ContinuousDumpConfig::ContinuousDumpConfig() = default; |
| JavaHprofConfig::ContinuousDumpConfig::~ContinuousDumpConfig() = default; |
| JavaHprofConfig::ContinuousDumpConfig::ContinuousDumpConfig( |
| const JavaHprofConfig::ContinuousDumpConfig&) = default; |
| JavaHprofConfig::ContinuousDumpConfig& JavaHprofConfig::ContinuousDumpConfig:: |
| operator=(const JavaHprofConfig::ContinuousDumpConfig&) = default; |
| JavaHprofConfig::ContinuousDumpConfig::ContinuousDumpConfig( |
| JavaHprofConfig::ContinuousDumpConfig&&) noexcept = default; |
| JavaHprofConfig::ContinuousDumpConfig& JavaHprofConfig::ContinuousDumpConfig:: |
| operator=(JavaHprofConfig::ContinuousDumpConfig&&) = default; |
| |
| #pragma GCC diagnostic push |
| #pragma GCC diagnostic ignored "-Wfloat-equal" |
| bool JavaHprofConfig::ContinuousDumpConfig::operator==( |
| const JavaHprofConfig::ContinuousDumpConfig& other) const { |
| return (dump_phase_ms_ == other.dump_phase_ms_) && |
| (dump_interval_ms_ == other.dump_interval_ms_); |
| } |
| #pragma GCC diagnostic pop |
| |
| void JavaHprofConfig::ContinuousDumpConfig::ParseRawProto( |
| const std::string& raw) { |
| perfetto::protos::JavaHprofConfig_ContinuousDumpConfig proto; |
| proto.ParseFromString(raw); |
| FromProto(proto); |
| } |
| |
| void JavaHprofConfig::ContinuousDumpConfig::FromProto( |
| const perfetto::protos::JavaHprofConfig_ContinuousDumpConfig& proto) { |
| static_assert(sizeof(dump_phase_ms_) == sizeof(proto.dump_phase_ms()), |
| "size mismatch"); |
| dump_phase_ms_ = static_cast<decltype(dump_phase_ms_)>(proto.dump_phase_ms()); |
| |
| static_assert(sizeof(dump_interval_ms_) == sizeof(proto.dump_interval_ms()), |
| "size mismatch"); |
| dump_interval_ms_ = |
| static_cast<decltype(dump_interval_ms_)>(proto.dump_interval_ms()); |
| unknown_fields_ = proto.unknown_fields(); |
| } |
| |
| void JavaHprofConfig::ContinuousDumpConfig::ToProto( |
| perfetto::protos::JavaHprofConfig_ContinuousDumpConfig* proto) const { |
| proto->Clear(); |
| |
| static_assert(sizeof(dump_phase_ms_) == sizeof(proto->dump_phase_ms()), |
| "size mismatch"); |
| proto->set_dump_phase_ms( |
| static_cast<decltype(proto->dump_phase_ms())>(dump_phase_ms_)); |
| |
| static_assert(sizeof(dump_interval_ms_) == sizeof(proto->dump_interval_ms()), |
| "size mismatch"); |
| proto->set_dump_interval_ms( |
| static_cast<decltype(proto->dump_interval_ms())>(dump_interval_ms_)); |
| *(proto->mutable_unknown_fields()) = unknown_fields_; |
| } |
| |
| } // namespace perfetto |