• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 IsPrivateModeEnable();
32 bool IsPrivateSwitchOn();
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 bool IsDebuggableHap();
38 uint16_t GetGlobalLogLevel();
39 uint16_t GetGlobalLevel();
40 uint16_t GetPersistGlobalLevel();
41 uint16_t GetDomainLevel(uint32_t domain);
42 uint16_t GetPersistDomainLevel(uint32_t domain);
43 uint16_t GetTagLevel(const std::string& tag);
44 uint16_t GetPersistTagLevel(const std::string& tag);
45 bool IsProcessSwitchOn();
46 bool IsDomainSwitchOn();
47 bool IsKmsgSwitchOn();
48 size_t GetBufferSize(uint16_t type, bool persist);
49 int GetProcessQuota(const std::string& proc);
50 int GetDomainQuota(uint32_t domain);
51 bool IsStatsEnable();
52 bool IsTagStatsEnable();
53 
54 int SetPrivateSwitchOn(bool on);
55 int SetOnceDebugOn(bool on);
56 int SetPersistDebugOn(bool on);
57 int SetGlobalLevel(uint16_t lvl);
58 int SetPersistGlobalLevel(uint16_t lvl);
59 int SetTagLevel(const std::string& tag, uint16_t lvl);
60 int SetPersistTagLevel(const std::string& tag, uint16_t lvl);
61 int SetDomainLevel(uint32_t domain, uint16_t lvl);
62 int SetPersistDomainLevel(uint32_t domain, uint16_t lvl);
63 int SetProcessSwitchOn(bool on);
64 int SetDomainSwitchOn(bool on);
65 int SetKmsgSwitchOn(bool on);
66 int SetBufferSize(uint16_t type, bool persist, size_t size);
67 } // namespace HiviewDFX
68 } // namespace OHOS
69 #endif
70