• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/common/trace_stats.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_TRACE_STATS_H_
29 #define INCLUDE_PERFETTO_TRACING_CORE_TRACE_STATS_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 TraceStats;
42 class TraceStats_BufferStats;
43 }  // namespace protos
44 }  // namespace perfetto
45 
46 namespace perfetto {
47 
48 class PERFETTO_EXPORT TraceStats {
49  public:
50   class PERFETTO_EXPORT BufferStats {
51    public:
52     BufferStats();
53     ~BufferStats();
54     BufferStats(BufferStats&&) noexcept;
55     BufferStats& operator=(BufferStats&&);
56     BufferStats(const BufferStats&);
57     BufferStats& operator=(const BufferStats&);
58     bool operator==(const BufferStats&) const;
59     bool operator!=(const BufferStats& other) const {
60       return !(*this == other);
61     }
62 
63     // Conversion methods from/to the corresponding protobuf types.
64     void FromProto(const perfetto::protos::TraceStats_BufferStats&);
65     void ToProto(perfetto::protos::TraceStats_BufferStats*) const;
66 
buffer_size()67     uint64_t buffer_size() const { return buffer_size_; }
set_buffer_size(uint64_t value)68     void set_buffer_size(uint64_t value) { buffer_size_ = value; }
69 
bytes_written()70     uint64_t bytes_written() const { return bytes_written_; }
set_bytes_written(uint64_t value)71     void set_bytes_written(uint64_t value) { bytes_written_ = value; }
72 
bytes_overwritten()73     uint64_t bytes_overwritten() const { return bytes_overwritten_; }
set_bytes_overwritten(uint64_t value)74     void set_bytes_overwritten(uint64_t value) { bytes_overwritten_ = value; }
75 
bytes_read()76     uint64_t bytes_read() const { return bytes_read_; }
set_bytes_read(uint64_t value)77     void set_bytes_read(uint64_t value) { bytes_read_ = value; }
78 
padding_bytes_written()79     uint64_t padding_bytes_written() const { return padding_bytes_written_; }
set_padding_bytes_written(uint64_t value)80     void set_padding_bytes_written(uint64_t value) {
81       padding_bytes_written_ = value;
82     }
83 
padding_bytes_cleared()84     uint64_t padding_bytes_cleared() const { return padding_bytes_cleared_; }
set_padding_bytes_cleared(uint64_t value)85     void set_padding_bytes_cleared(uint64_t value) {
86       padding_bytes_cleared_ = value;
87     }
88 
chunks_written()89     uint64_t chunks_written() const { return chunks_written_; }
set_chunks_written(uint64_t value)90     void set_chunks_written(uint64_t value) { chunks_written_ = value; }
91 
chunks_rewritten()92     uint64_t chunks_rewritten() const { return chunks_rewritten_; }
set_chunks_rewritten(uint64_t value)93     void set_chunks_rewritten(uint64_t value) { chunks_rewritten_ = value; }
94 
chunks_overwritten()95     uint64_t chunks_overwritten() const { return chunks_overwritten_; }
set_chunks_overwritten(uint64_t value)96     void set_chunks_overwritten(uint64_t value) { chunks_overwritten_ = value; }
97 
chunks_discarded()98     uint64_t chunks_discarded() const { return chunks_discarded_; }
set_chunks_discarded(uint64_t value)99     void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; }
100 
chunks_read()101     uint64_t chunks_read() const { return chunks_read_; }
set_chunks_read(uint64_t value)102     void set_chunks_read(uint64_t value) { chunks_read_ = value; }
103 
chunks_committed_out_of_order()104     uint64_t chunks_committed_out_of_order() const {
105       return chunks_committed_out_of_order_;
106     }
set_chunks_committed_out_of_order(uint64_t value)107     void set_chunks_committed_out_of_order(uint64_t value) {
108       chunks_committed_out_of_order_ = value;
109     }
110 
write_wrap_count()111     uint64_t write_wrap_count() const { return write_wrap_count_; }
set_write_wrap_count(uint64_t value)112     void set_write_wrap_count(uint64_t value) { write_wrap_count_ = value; }
113 
patches_succeeded()114     uint64_t patches_succeeded() const { return patches_succeeded_; }
set_patches_succeeded(uint64_t value)115     void set_patches_succeeded(uint64_t value) { patches_succeeded_ = value; }
116 
patches_failed()117     uint64_t patches_failed() const { return patches_failed_; }
set_patches_failed(uint64_t value)118     void set_patches_failed(uint64_t value) { patches_failed_ = value; }
119 
readaheads_succeeded()120     uint64_t readaheads_succeeded() const { return readaheads_succeeded_; }
set_readaheads_succeeded(uint64_t value)121     void set_readaheads_succeeded(uint64_t value) {
122       readaheads_succeeded_ = value;
123     }
124 
readaheads_failed()125     uint64_t readaheads_failed() const { return readaheads_failed_; }
set_readaheads_failed(uint64_t value)126     void set_readaheads_failed(uint64_t value) { readaheads_failed_ = value; }
127 
abi_violations()128     uint64_t abi_violations() const { return abi_violations_; }
set_abi_violations(uint64_t value)129     void set_abi_violations(uint64_t value) { abi_violations_ = value; }
130 
131    private:
132     uint64_t buffer_size_ = {};
133     uint64_t bytes_written_ = {};
134     uint64_t bytes_overwritten_ = {};
135     uint64_t bytes_read_ = {};
136     uint64_t padding_bytes_written_ = {};
137     uint64_t padding_bytes_cleared_ = {};
138     uint64_t chunks_written_ = {};
139     uint64_t chunks_rewritten_ = {};
140     uint64_t chunks_overwritten_ = {};
141     uint64_t chunks_discarded_ = {};
142     uint64_t chunks_read_ = {};
143     uint64_t chunks_committed_out_of_order_ = {};
144     uint64_t write_wrap_count_ = {};
145     uint64_t patches_succeeded_ = {};
146     uint64_t patches_failed_ = {};
147     uint64_t readaheads_succeeded_ = {};
148     uint64_t readaheads_failed_ = {};
149     uint64_t abi_violations_ = {};
150 
151     // Allows to preserve unknown protobuf fields for compatibility
152     // with future versions of .proto files.
153     std::string unknown_fields_;
154   };
155 
156   TraceStats();
157   ~TraceStats();
158   TraceStats(TraceStats&&) noexcept;
159   TraceStats& operator=(TraceStats&&);
160   TraceStats(const TraceStats&);
161   TraceStats& operator=(const TraceStats&);
162   bool operator==(const TraceStats&) const;
163   bool operator!=(const TraceStats& other) const { return !(*this == other); }
164 
165   // Conversion methods from/to the corresponding protobuf types.
166   void FromProto(const perfetto::protos::TraceStats&);
167   void ToProto(perfetto::protos::TraceStats*) const;
168 
buffer_stats_size()169   int buffer_stats_size() const {
170     return static_cast<int>(buffer_stats_.size());
171   }
buffer_stats()172   const std::vector<BufferStats>& buffer_stats() const { return buffer_stats_; }
mutable_buffer_stats()173   std::vector<BufferStats>* mutable_buffer_stats() { return &buffer_stats_; }
clear_buffer_stats()174   void clear_buffer_stats() { buffer_stats_.clear(); }
add_buffer_stats()175   BufferStats* add_buffer_stats() {
176     buffer_stats_.emplace_back();
177     return &buffer_stats_.back();
178   }
179 
producers_connected()180   uint32_t producers_connected() const { return producers_connected_; }
set_producers_connected(uint32_t value)181   void set_producers_connected(uint32_t value) { producers_connected_ = value; }
182 
producers_seen()183   uint64_t producers_seen() const { return producers_seen_; }
set_producers_seen(uint64_t value)184   void set_producers_seen(uint64_t value) { producers_seen_ = value; }
185 
data_sources_registered()186   uint32_t data_sources_registered() const { return data_sources_registered_; }
set_data_sources_registered(uint32_t value)187   void set_data_sources_registered(uint32_t value) {
188     data_sources_registered_ = value;
189   }
190 
data_sources_seen()191   uint64_t data_sources_seen() const { return data_sources_seen_; }
set_data_sources_seen(uint64_t value)192   void set_data_sources_seen(uint64_t value) { data_sources_seen_ = value; }
193 
tracing_sessions()194   uint32_t tracing_sessions() const { return tracing_sessions_; }
set_tracing_sessions(uint32_t value)195   void set_tracing_sessions(uint32_t value) { tracing_sessions_ = value; }
196 
total_buffers()197   uint32_t total_buffers() const { return total_buffers_; }
set_total_buffers(uint32_t value)198   void set_total_buffers(uint32_t value) { total_buffers_ = value; }
199 
chunks_discarded()200   uint64_t chunks_discarded() const { return chunks_discarded_; }
set_chunks_discarded(uint64_t value)201   void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; }
202 
patches_discarded()203   uint64_t patches_discarded() const { return patches_discarded_; }
set_patches_discarded(uint64_t value)204   void set_patches_discarded(uint64_t value) { patches_discarded_ = value; }
205 
206  private:
207   std::vector<BufferStats> buffer_stats_;
208   uint32_t producers_connected_ = {};
209   uint64_t producers_seen_ = {};
210   uint32_t data_sources_registered_ = {};
211   uint64_t data_sources_seen_ = {};
212   uint32_t tracing_sessions_ = {};
213   uint32_t total_buffers_ = {};
214   uint64_t chunks_discarded_ = {};
215   uint64_t patches_discarded_ = {};
216 
217   // Allows to preserve unknown protobuf fields for compatibility
218   // with future versions of .proto files.
219   std::string unknown_fields_;
220 };
221 
222 }  // namespace perfetto
223 
224 #endif  // INCLUDE_PERFETTO_TRACING_CORE_TRACE_STATS_H_
225