1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PROPERTIES_H 17 #define PROPERTIES_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace HiviewDFX { 23 24 bool IsOnceDebugOn(); 25 bool IsPersistDebugOn(); 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 bool IsDebugOn(); 31 bool IsPrivateSwitchOn(); 32 33 #ifdef __cplusplus 34 } 35 #endif 36 bool IsDebuggableHap(); 37 uint16_t GetGlobalLevel(); 38 uint16_t GetDomainLevel(uint32_t domain); 39 uint16_t GetTagLevel(const std::string& tag); 40 bool IsProcessSwitchOn(); 41 bool IsDomainSwitchOn(); 42 bool IsKmsgSwitchOn(); 43 size_t GetBufferSize(uint16_t type, bool persist); 44 int GetProcessQuota(const std::string& proc); 45 int GetDomainQuota(uint32_t domain); 46 bool IsStatsEnable(); 47 bool IsTagStatsEnable(); 48 49 int SetPrivateSwitchOn(bool on); 50 int SetOnceDebugOn(bool on); 51 int SetPersistDebugOn(bool on); 52 int SetGlobalLevel(uint16_t lvl); 53 int SetTagLevel(const std::string& tag, uint16_t lvl); 54 int SetDomainLevel(uint32_t domain, uint16_t lvl); 55 int SetProcessSwitchOn(bool on); 56 int SetDomainSwitchOn(bool on); 57 int SetKmsgSwitchOn(bool on); 58 int SetBufferSize(uint16_t type, bool persist, size_t size); 59 } // namespace HiviewDFX 60 } // namespace OHOS 61 #endif 62