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/android/android_log_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_ANDROID_LOG_CONFIG_H_
     29 #define INCLUDE_PERFETTO_TRACING_CORE_ANDROID_LOG_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/android_log_constants.h"
     39 
     40 // Forward declarations for protobuf types.
     41 namespace perfetto {
     42 namespace protos {
     43 class AndroidLogConfig;
     44 }
     45 }  // namespace perfetto
     46 
     47 namespace perfetto {
     48 
     49 class PERFETTO_EXPORT AndroidLogConfig {
     50  public:
     51   enum AndroidLogId {
     52     LID_DEFAULT = 0,
     53     LID_RADIO = 1,
     54     LID_EVENTS = 2,
     55     LID_SYSTEM = 3,
     56     LID_CRASH = 4,
     57     LID_STATS = 5,
     58     LID_SECURITY = 6,
     59     LID_KERNEL = 7,
     60   };
     61   enum AndroidLogPriority {
     62     PRIO_UNSPECIFIED = 0,
     63     PRIO_UNUSED = 1,
     64     PRIO_VERBOSE = 2,
     65     PRIO_DEBUG = 3,
     66     PRIO_INFO = 4,
     67     PRIO_WARN = 5,
     68     PRIO_ERROR = 6,
     69     PRIO_FATAL = 7,
     70   };
     71   AndroidLogConfig();
     72   ~AndroidLogConfig();
     73   AndroidLogConfig(AndroidLogConfig&&) noexcept;
     74   AndroidLogConfig& operator=(AndroidLogConfig&&);
     75   AndroidLogConfig(const AndroidLogConfig&);
     76   AndroidLogConfig& operator=(const AndroidLogConfig&);
     77   bool operator==(const AndroidLogConfig&) const;
     78   bool operator!=(const AndroidLogConfig& other) const {
     79     return !(*this == other);
     80   }
     81 
     82   // Conversion methods from/to the corresponding protobuf types.
     83   void FromProto(const perfetto::protos::AndroidLogConfig&);
     84   void ToProto(perfetto::protos::AndroidLogConfig*) const;
     85 
     86   int log_ids_size() const { return static_cast<int>(log_ids_.size()); }
     87   const std::vector<AndroidLogId>& log_ids() const { return log_ids_; }
     88   std::vector<AndroidLogId>* mutable_log_ids() { return &log_ids_; }
     89   void clear_log_ids() { log_ids_.clear(); }
     90   AndroidLogId* add_log_ids() {
     91     log_ids_.emplace_back();
     92     return &log_ids_.back();
     93   }
     94 
     95   AndroidLogPriority min_prio() const { return min_prio_; }
     96   void set_min_prio(AndroidLogPriority value) { min_prio_ = value; }
     97 
     98   int filter_tags_size() const { return static_cast<int>(filter_tags_.size()); }
     99   const std::vector<std::string>& filter_tags() const { return filter_tags_; }
    100   std::vector<std::string>* mutable_filter_tags() { return &filter_tags_; }
    101   void clear_filter_tags() { filter_tags_.clear(); }
    102   std::string* add_filter_tags() {
    103     filter_tags_.emplace_back();
    104     return &filter_tags_.back();
    105   }
    106 
    107  private:
    108   std::vector<AndroidLogId> log_ids_;
    109   AndroidLogPriority min_prio_ = {};
    110   std::vector<std::string> filter_tags_;
    111 
    112   // Allows to preserve unknown protobuf fields for compatibility
    113   // with future versions of .proto files.
    114   std::string unknown_fields_;
    115 };
    116 
    117 }  // namespace perfetto
    118 
    119 #endif  // INCLUDE_PERFETTO_TRACING_CORE_ANDROID_LOG_CONFIG_H_
    120