Home | History | Annotate | Download | only in core
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /*******************************************************************************
     18  * AUTOGENERATED - DO NOT EDIT
     19  *******************************************************************************
     20  * This file has been generated from the protobuf message
     21  * perfetto/config/profiling/heapprofd_config.proto
     22  * by
     23  * ../../tools/proto_to_cpp/proto_to_cpp.cc.
     24  * If you need to make changes here, change the .proto file and then run
     25  * ./tools/gen_tracing_cpp_headers_from_protos
     26  */
     27 
     28 #ifndef INCLUDE_PERFETTO_TRACING_CORE_HEAPPROFD_CONFIG_H_
     29 #define INCLUDE_PERFETTO_TRACING_CORE_HEAPPROFD_CONFIG_H_
     30 
     31 #include <stdint.h>
     32 #include <string>
     33 #include <type_traits>
     34 #include <vector>
     35 
     36 #include "perfetto/base/export.h"
     37 
     38 // Forward declarations for protobuf types.
     39 namespace perfetto {
     40 namespace protos {
     41 class HeapprofdConfig;
     42 class HeapprofdConfig_ContinuousDumpConfig;
     43 }  // namespace protos
     44 }  // namespace perfetto
     45 
     46 namespace perfetto {
     47 
     48 class PERFETTO_EXPORT HeapprofdConfig {
     49  public:
     50   class PERFETTO_EXPORT ContinuousDumpConfig {
     51    public:
     52     ContinuousDumpConfig();
     53     ~ContinuousDumpConfig();
     54     ContinuousDumpConfig(ContinuousDumpConfig&&) noexcept;
     55     ContinuousDumpConfig& operator=(ContinuousDumpConfig&&);
     56     ContinuousDumpConfig(const ContinuousDumpConfig&);
     57     ContinuousDumpConfig& operator=(const ContinuousDumpConfig&);
     58     bool operator==(const ContinuousDumpConfig&) const;
     59     bool operator!=(const ContinuousDumpConfig& other) const {
     60       return !(*this == other);
     61     }
     62 
     63     // Conversion methods from/to the corresponding protobuf types.
     64     void FromProto(
     65         const perfetto::protos::HeapprofdConfig_ContinuousDumpConfig&);
     66     void ToProto(perfetto::protos::HeapprofdConfig_ContinuousDumpConfig*) const;
     67 
     68     uint32_t dump_phase_ms() const { return dump_phase_ms_; }
     69     void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; }
     70 
     71     uint32_t dump_interval_ms() const { return dump_interval_ms_; }
     72     void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; }
     73 
     74    private:
     75     uint32_t dump_phase_ms_ = {};
     76     uint32_t dump_interval_ms_ = {};
     77 
     78     // Allows to preserve unknown protobuf fields for compatibility
     79     // with future versions of .proto files.
     80     std::string unknown_fields_;
     81   };
     82 
     83   HeapprofdConfig();
     84   ~HeapprofdConfig();
     85   HeapprofdConfig(HeapprofdConfig&&) noexcept;
     86   HeapprofdConfig& operator=(HeapprofdConfig&&);
     87   HeapprofdConfig(const HeapprofdConfig&);
     88   HeapprofdConfig& operator=(const HeapprofdConfig&);
     89   bool operator==(const HeapprofdConfig&) const;
     90   bool operator!=(const HeapprofdConfig& other) const {
     91     return !(*this == other);
     92   }
     93 
     94   // Conversion methods from/to the corresponding protobuf types.
     95   void FromProto(const perfetto::protos::HeapprofdConfig&);
     96   void ToProto(perfetto::protos::HeapprofdConfig*) const;
     97 
     98   uint64_t sampling_interval_bytes() const { return sampling_interval_bytes_; }
     99   void set_sampling_interval_bytes(uint64_t value) {
    100     sampling_interval_bytes_ = value;
    101   }
    102 
    103   int process_cmdline_size() const {
    104     return static_cast<int>(process_cmdline_.size());
    105   }
    106   const std::vector<std::string>& process_cmdline() const {
    107     return process_cmdline_;
    108   }
    109   std::vector<std::string>* mutable_process_cmdline() {
    110     return &process_cmdline_;
    111   }
    112   void clear_process_cmdline() { process_cmdline_.clear(); }
    113   std::string* add_process_cmdline() {
    114     process_cmdline_.emplace_back();
    115     return &process_cmdline_.back();
    116   }
    117 
    118   int pid_size() const { return static_cast<int>(pid_.size()); }
    119   const std::vector<uint64_t>& pid() const { return pid_; }
    120   std::vector<uint64_t>* mutable_pid() { return &pid_; }
    121   void clear_pid() { pid_.clear(); }
    122   uint64_t* add_pid() {
    123     pid_.emplace_back();
    124     return &pid_.back();
    125   }
    126 
    127   bool all() const { return all_; }
    128   void set_all(bool value) { all_ = value; }
    129 
    130   int skip_symbol_prefix_size() const {
    131     return static_cast<int>(skip_symbol_prefix_.size());
    132   }
    133   const std::vector<std::string>& skip_symbol_prefix() const {
    134     return skip_symbol_prefix_;
    135   }
    136   std::vector<std::string>* mutable_skip_symbol_prefix() {
    137     return &skip_symbol_prefix_;
    138   }
    139   void clear_skip_symbol_prefix() { skip_symbol_prefix_.clear(); }
    140   std::string* add_skip_symbol_prefix() {
    141     skip_symbol_prefix_.emplace_back();
    142     return &skip_symbol_prefix_.back();
    143   }
    144 
    145   const ContinuousDumpConfig& continuous_dump_config() const {
    146     return continuous_dump_config_;
    147   }
    148   ContinuousDumpConfig* mutable_continuous_dump_config() {
    149     return &continuous_dump_config_;
    150   }
    151 
    152   uint64_t shmem_size_bytes() const { return shmem_size_bytes_; }
    153   void set_shmem_size_bytes(uint64_t value) { shmem_size_bytes_ = value; }
    154 
    155   bool block_client() const { return block_client_; }
    156   void set_block_client(bool value) { block_client_ = value; }
    157 
    158  private:
    159   uint64_t sampling_interval_bytes_ = {};
    160   std::vector<std::string> process_cmdline_;
    161   std::vector<uint64_t> pid_;
    162   bool all_ = {};
    163   std::vector<std::string> skip_symbol_prefix_;
    164   ContinuousDumpConfig continuous_dump_config_ = {};
    165   uint64_t shmem_size_bytes_ = {};
    166   bool block_client_ = {};
    167 
    168   // Allows to preserve unknown protobuf fields for compatibility
    169   // with future versions of .proto files.
    170   std::string unknown_fields_;
    171 };
    172 
    173 }  // namespace perfetto
    174 
    175 #endif  // INCLUDE_PERFETTO_TRACING_CORE_HEAPPROFD_CONFIG_H_
    176