1 /*
2  * Copyright (c) 2021-2023 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 #ifndef DFX_CONFIG_H
16 #define DFX_CONFIG_H
17 
18 #include <string>
19 
20 namespace OHOS {
21 namespace HiviewDFX {
22 struct DfxConfigInfo {
23     bool displayBacktrace = true;
24     bool displayRegister = true;
25     bool displayMaps = true;
26     bool displayFaultStack = true;
27     bool dumpOtherThreads = true;
28     unsigned int lowAddressStep = 16;
29     unsigned int highAddressStep = 512;
30     unsigned int maxFrameNums = 256;
31 };
32 
33 class DfxConfig {
34 public:
35     static DfxConfigInfo& GetConfig();
36 
37 private:
38     static void ReadConfig(DfxConfigInfo& config);
39     static void ParserConfig(DfxConfigInfo& config, const std::string& key, const std::string& value);
40 private:
41     DfxConfig() = default;
42     ~DfxConfig() = default;
43 };
44 } // namespace HiviewDFX
45 } // namespace OHOS
46 
47 #endif
48