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/sys_stats/sys_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_SYS_STATS_CONFIG_H_
     29 #define INCLUDE_PERFETTO_TRACING_CORE_SYS_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 #include "perfetto/tracing/core/sys_stats_counters.h"
     39 
     40 // Forward declarations for protobuf types.
     41 namespace perfetto {
     42 namespace protos {
     43 class SysStatsConfig;
     44 }
     45 }  // namespace perfetto
     46 
     47 namespace perfetto {
     48 
     49 class PERFETTO_EXPORT SysStatsConfig {
     50  public:
     51   enum MeminfoCounters {
     52     MEMINFO_UNSPECIFIED = 0,
     53     MEMINFO_MEM_TOTAL = 1,
     54     MEMINFO_MEM_FREE = 2,
     55     MEMINFO_MEM_AVAILABLE = 3,
     56     MEMINFO_BUFFERS = 4,
     57     MEMINFO_CACHED = 5,
     58     MEMINFO_SWAP_CACHED = 6,
     59     MEMINFO_ACTIVE = 7,
     60     MEMINFO_INACTIVE = 8,
     61     MEMINFO_ACTIVE_ANON = 9,
     62     MEMINFO_INACTIVE_ANON = 10,
     63     MEMINFO_ACTIVE_FILE = 11,
     64     MEMINFO_INACTIVE_FILE = 12,
     65     MEMINFO_UNEVICTABLE = 13,
     66     MEMINFO_MLOCKED = 14,
     67     MEMINFO_SWAP_TOTAL = 15,
     68     MEMINFO_SWAP_FREE = 16,
     69     MEMINFO_DIRTY = 17,
     70     MEMINFO_WRITEBACK = 18,
     71     MEMINFO_ANON_PAGES = 19,
     72     MEMINFO_MAPPED = 20,
     73     MEMINFO_SHMEM = 21,
     74     MEMINFO_SLAB = 22,
     75     MEMINFO_SLAB_RECLAIMABLE = 23,
     76     MEMINFO_SLAB_UNRECLAIMABLE = 24,
     77     MEMINFO_KERNEL_STACK = 25,
     78     MEMINFO_PAGE_TABLES = 26,
     79     MEMINFO_COMMIT_LIMIT = 27,
     80     MEMINFO_COMMITED_AS = 28,
     81     MEMINFO_VMALLOC_TOTAL = 29,
     82     MEMINFO_VMALLOC_USED = 30,
     83     MEMINFO_VMALLOC_CHUNK = 31,
     84     MEMINFO_CMA_TOTAL = 32,
     85     MEMINFO_CMA_FREE = 33,
     86   };
     87   enum VmstatCounters {
     88     VMSTAT_UNSPECIFIED = 0,
     89     VMSTAT_NR_FREE_PAGES = 1,
     90     VMSTAT_NR_ALLOC_BATCH = 2,
     91     VMSTAT_NR_INACTIVE_ANON = 3,
     92     VMSTAT_NR_ACTIVE_ANON = 4,
     93     VMSTAT_NR_INACTIVE_FILE = 5,
     94     VMSTAT_NR_ACTIVE_FILE = 6,
     95     VMSTAT_NR_UNEVICTABLE = 7,
     96     VMSTAT_NR_MLOCK = 8,
     97     VMSTAT_NR_ANON_PAGES = 9,
     98     VMSTAT_NR_MAPPED = 10,
     99     VMSTAT_NR_FILE_PAGES = 11,
    100     VMSTAT_NR_DIRTY = 12,
    101     VMSTAT_NR_WRITEBACK = 13,
    102     VMSTAT_NR_SLAB_RECLAIMABLE = 14,
    103     VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
    104     VMSTAT_NR_PAGE_TABLE_PAGES = 16,
    105     VMSTAT_NR_KERNEL_STACK = 17,
    106     VMSTAT_NR_OVERHEAD = 18,
    107     VMSTAT_NR_UNSTABLE = 19,
    108     VMSTAT_NR_BOUNCE = 20,
    109     VMSTAT_NR_VMSCAN_WRITE = 21,
    110     VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
    111     VMSTAT_NR_WRITEBACK_TEMP = 23,
    112     VMSTAT_NR_ISOLATED_ANON = 24,
    113     VMSTAT_NR_ISOLATED_FILE = 25,
    114     VMSTAT_NR_SHMEM = 26,
    115     VMSTAT_NR_DIRTIED = 27,
    116     VMSTAT_NR_WRITTEN = 28,
    117     VMSTAT_NR_PAGES_SCANNED = 29,
    118     VMSTAT_WORKINGSET_REFAULT = 30,
    119     VMSTAT_WORKINGSET_ACTIVATE = 31,
    120     VMSTAT_WORKINGSET_NODERECLAIM = 32,
    121     VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
    122     VMSTAT_NR_FREE_CMA = 34,
    123     VMSTAT_NR_SWAPCACHE = 35,
    124     VMSTAT_NR_DIRTY_THRESHOLD = 36,
    125     VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
    126     VMSTAT_PGPGIN = 38,
    127     VMSTAT_PGPGOUT = 39,
    128     VMSTAT_PGPGOUTCLEAN = 40,
    129     VMSTAT_PSWPIN = 41,
    130     VMSTAT_PSWPOUT = 42,
    131     VMSTAT_PGALLOC_DMA = 43,
    132     VMSTAT_PGALLOC_NORMAL = 44,
    133     VMSTAT_PGALLOC_MOVABLE = 45,
    134     VMSTAT_PGFREE = 46,
    135     VMSTAT_PGACTIVATE = 47,
    136     VMSTAT_PGDEACTIVATE = 48,
    137     VMSTAT_PGFAULT = 49,
    138     VMSTAT_PGMAJFAULT = 50,
    139     VMSTAT_PGREFILL_DMA = 51,
    140     VMSTAT_PGREFILL_NORMAL = 52,
    141     VMSTAT_PGREFILL_MOVABLE = 53,
    142     VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
    143     VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
    144     VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
    145     VMSTAT_PGSTEAL_DIRECT_DMA = 57,
    146     VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
    147     VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
    148     VMSTAT_PGSCAN_KSWAPD_DMA = 60,
    149     VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
    150     VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
    151     VMSTAT_PGSCAN_DIRECT_DMA = 63,
    152     VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
    153     VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
    154     VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
    155     VMSTAT_PGINODESTEAL = 67,
    156     VMSTAT_SLABS_SCANNED = 68,
    157     VMSTAT_KSWAPD_INODESTEAL = 69,
    158     VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
    159     VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
    160     VMSTAT_PAGEOUTRUN = 72,
    161     VMSTAT_ALLOCSTALL = 73,
    162     VMSTAT_PGROTATED = 74,
    163     VMSTAT_DROP_PAGECACHE = 75,
    164     VMSTAT_DROP_SLAB = 76,
    165     VMSTAT_PGMIGRATE_SUCCESS = 77,
    166     VMSTAT_PGMIGRATE_FAIL = 78,
    167     VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
    168     VMSTAT_COMPACT_FREE_SCANNED = 80,
    169     VMSTAT_COMPACT_ISOLATED = 81,
    170     VMSTAT_COMPACT_STALL = 82,
    171     VMSTAT_COMPACT_FAIL = 83,
    172     VMSTAT_COMPACT_SUCCESS = 84,
    173     VMSTAT_COMPACT_DAEMON_WAKE = 85,
    174     VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
    175     VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
    176     VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
    177     VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
    178     VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
    179     VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
    180     VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
    181   };
    182   enum StatCounters {
    183     STAT_UNSPECIFIED = 0,
    184     STAT_CPU_TIMES = 1,
    185     STAT_IRQ_COUNTS = 2,
    186     STAT_SOFTIRQ_COUNTS = 3,
    187     STAT_FORK_COUNT = 4,
    188   };
    189   SysStatsConfig();
    190   ~SysStatsConfig();
    191   SysStatsConfig(SysStatsConfig&&) noexcept;
    192   SysStatsConfig& operator=(SysStatsConfig&&);
    193   SysStatsConfig(const SysStatsConfig&);
    194   SysStatsConfig& operator=(const SysStatsConfig&);
    195   bool operator==(const SysStatsConfig&) const;
    196   bool operator!=(const SysStatsConfig& other) const {
    197     return !(*this == other);
    198   }
    199 
    200   // Conversion methods from/to the corresponding protobuf types.
    201   void FromProto(const perfetto::protos::SysStatsConfig&);
    202   void ToProto(perfetto::protos::SysStatsConfig*) const;
    203 
    204   uint32_t meminfo_period_ms() const { return meminfo_period_ms_; }
    205   void set_meminfo_period_ms(uint32_t value) { meminfo_period_ms_ = value; }
    206 
    207   int meminfo_counters_size() const {
    208     return static_cast<int>(meminfo_counters_.size());
    209   }
    210   const std::vector<MeminfoCounters>& meminfo_counters() const {
    211     return meminfo_counters_;
    212   }
    213   std::vector<MeminfoCounters>* mutable_meminfo_counters() {
    214     return &meminfo_counters_;
    215   }
    216   void clear_meminfo_counters() { meminfo_counters_.clear(); }
    217   MeminfoCounters* add_meminfo_counters() {
    218     meminfo_counters_.emplace_back();
    219     return &meminfo_counters_.back();
    220   }
    221 
    222   uint32_t vmstat_period_ms() const { return vmstat_period_ms_; }
    223   void set_vmstat_period_ms(uint32_t value) { vmstat_period_ms_ = value; }
    224 
    225   int vmstat_counters_size() const {
    226     return static_cast<int>(vmstat_counters_.size());
    227   }
    228   const std::vector<VmstatCounters>& vmstat_counters() const {
    229     return vmstat_counters_;
    230   }
    231   std::vector<VmstatCounters>* mutable_vmstat_counters() {
    232     return &vmstat_counters_;
    233   }
    234   void clear_vmstat_counters() { vmstat_counters_.clear(); }
    235   VmstatCounters* add_vmstat_counters() {
    236     vmstat_counters_.emplace_back();
    237     return &vmstat_counters_.back();
    238   }
    239 
    240   uint32_t stat_period_ms() const { return stat_period_ms_; }
    241   void set_stat_period_ms(uint32_t value) { stat_period_ms_ = value; }
    242 
    243   int stat_counters_size() const {
    244     return static_cast<int>(stat_counters_.size());
    245   }
    246   const std::vector<StatCounters>& stat_counters() const {
    247     return stat_counters_;
    248   }
    249   std::vector<StatCounters>* mutable_stat_counters() { return &stat_counters_; }
    250   void clear_stat_counters() { stat_counters_.clear(); }
    251   StatCounters* add_stat_counters() {
    252     stat_counters_.emplace_back();
    253     return &stat_counters_.back();
    254   }
    255 
    256  private:
    257   uint32_t meminfo_period_ms_ = {};
    258   std::vector<MeminfoCounters> meminfo_counters_;
    259   uint32_t vmstat_period_ms_ = {};
    260   std::vector<VmstatCounters> vmstat_counters_;
    261   uint32_t stat_period_ms_ = {};
    262   std::vector<StatCounters> stat_counters_;
    263 
    264   // Allows to preserve unknown protobuf fields for compatibility
    265   // with future versions of .proto files.
    266   std::string unknown_fields_;
    267 };
    268 
    269 }  // namespace perfetto
    270 
    271 #endif  // INCLUDE_PERFETTO_TRACING_CORE_SYS_STATS_CONFIG_H_
    272