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 #ifndef HIDUMPER_SERVICES_DUMPER_OPTS_H
16 #define HIDUMPER_SERVICES_DUMPER_OPTS_H
17 #include <string>
18 #include <vector>
19 namespace OHOS {
20 namespace HiviewDFX {
21 struct DumperOpts {
22     bool isDumpCpuFreq_;
23     bool isDumpCpuUsage_;
24     int cpuUsagePid_;
25     bool isDumpLog_;
26     std::vector<std::string> logArgs_;
27     bool isDumpMem_;
28     int memPid_;
29     bool isDumpStorage_;
30     int storagePid_;
31     bool isDumpNet_;
32     int netPid_;
33     bool isDumpList_;
34     bool isDumpService_;
35     bool isDumpSystemAbility_;
36     std::vector<std::string> abilitieNames_;
37     std::vector<std::string> abilitieArgs_;
38     bool isDumpSystem_;
39     std::vector<std::string> systemArgs_;
40     bool isDumpProcesses_;
41     int processPid_;
42     bool isFaultLog_;
43     int timeout_;
44     int limitSize_;
45     std::string path_; // for zip
46     bool isAppendix_;
47     bool isTest_;
48     bool isShowSmaps_;
49     bool isShowSmapsInfo_;
50     bool isDumpJsHeapMem_;
51     bool isDumpJsHeapMemGC_;
52     bool isDumpJsHeapLeakobj_;
53     int dumpJsHeapMemPid_;
54     int threadId_;
55     int ipcStatPid_;
56     bool isDumpAllIpc_;
57     bool isDumpIpc_;
58     bool isDumpIpcStartStat_;
59     bool isDumpIpcStopStat_;
60     bool isDumpIpcStat_;
61 
62 public:
63     DumperOpts();
64     void Reset();
65     DumperOpts& operator = (const DumperOpts& opts);
66     void AddSelectAll();
67     bool IsSelectAny() const;
68     bool IsDumpZip() const;
69     bool CheckOptions(std::string& errStr) const;
70 };
71 } // namespace HiviewDFX
72 } // namespace OHOS
73 #endif // HIDUMPER_SERVICES_DUMPER_OPTS_H
74