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/process_stats/process_stats_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_PROCESS_STATS_CONFIG_H_ 29 #define INCLUDE_PERFETTO_TRACING_CORE_PROCESS_STATS_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 ProcessStatsConfig; 42 } 43 } // namespace perfetto 44 45 namespace perfetto { 46 47 class PERFETTO_EXPORT ProcessStatsConfig { 48 public: 49 enum Quirks { 50 QUIRKS_UNSPECIFIED = 0, 51 DISABLE_INITIAL_DUMP = 1, 52 DISABLE_ON_DEMAND = 2, 53 }; 54 ProcessStatsConfig(); 55 ~ProcessStatsConfig(); 56 ProcessStatsConfig(ProcessStatsConfig&&) noexcept; 57 ProcessStatsConfig& operator=(ProcessStatsConfig&&); 58 ProcessStatsConfig(const ProcessStatsConfig&); 59 ProcessStatsConfig& operator=(const ProcessStatsConfig&); 60 bool operator==(const ProcessStatsConfig&) const; 61 bool operator!=(const ProcessStatsConfig& other) const { 62 return !(*this == other); 63 } 64 65 // Conversion methods from/to the corresponding protobuf types. 66 void FromProto(const perfetto::protos::ProcessStatsConfig&); 67 void ToProto(perfetto::protos::ProcessStatsConfig*) const; 68 69 int quirks_size() const { return static_cast<int>(quirks_.size()); } 70 const std::vector<Quirks>& quirks() const { return quirks_; } 71 std::vector<Quirks>* mutable_quirks() { return &quirks_; } 72 void clear_quirks() { quirks_.clear(); } 73 Quirks* add_quirks() { 74 quirks_.emplace_back(); 75 return &quirks_.back(); 76 } 77 78 bool scan_all_processes_on_start() const { 79 return scan_all_processes_on_start_; 80 } 81 void set_scan_all_processes_on_start(bool value) { 82 scan_all_processes_on_start_ = value; 83 } 84 85 bool record_thread_names() const { return record_thread_names_; } 86 void set_record_thread_names(bool value) { record_thread_names_ = value; } 87 88 uint32_t proc_stats_poll_ms() const { return proc_stats_poll_ms_; } 89 void set_proc_stats_poll_ms(uint32_t value) { proc_stats_poll_ms_ = value; } 90 91 uint32_t proc_stats_cache_ttl_ms() const { return proc_stats_cache_ttl_ms_; } 92 void set_proc_stats_cache_ttl_ms(uint32_t value) { 93 proc_stats_cache_ttl_ms_ = value; 94 } 95 96 private: 97 std::vector<Quirks> quirks_; 98 bool scan_all_processes_on_start_ = {}; 99 bool record_thread_names_ = {}; 100 uint32_t proc_stats_poll_ms_ = {}; 101 uint32_t proc_stats_cache_ttl_ms_ = {}; 102 103 // Allows to preserve unknown protobuf fields for compatibility 104 // with future versions of .proto files. 105 std::string unknown_fields_; 106 }; 107 108 } // namespace perfetto 109 110 #endif // INCLUDE_PERFETTO_TRACING_CORE_PROCESS_STATS_CONFIG_H_ 111