• 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 #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     bool isDumpNet_;
31     bool isDumpList_;
32     bool isDumpService_;
33     bool isDumpSystemAbility_;
34     std::vector<std::string> abilitieNames_;
35     std::vector<std::string> abilitieArgs_;
36     bool isDumpSystem_;
37     std::vector<std::string> systemArgs_;
38     bool isDumpProcesses_;
39     int processPid_;
40     bool isFaultLog_;
41     int timeout_;
42     int limitSize_;
43     std::string path_; // for zip
44     bool isAppendix_;
45     bool isTest_;
46 public:
47     DumperOpts();
48     void Reset();
49     DumperOpts& operator = (const DumperOpts& opts);
50     void AddSelectAll();
51     bool IsSelectAny() const;
52     bool IsDumpZip() const;
53     bool CheckOptions(std::string& errStr) const;
54     void Dump() const;
55 };
56 } // namespace HiviewDFX
57 } // namespace OHOS
58 #endif // HIDUMPER_SERVICES_DUMPER_OPTS_H
59