1 /* 2 * Copyright (C) 2021-2022 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_PARAMETER_H 16 #define HIDUMPER_SERVICES_DUMPER_PARAMETER_H 17 18 #include <vector> 19 20 #include "common/dump_cfg.h" 21 #include "common/dumper_opts.h" 22 #include "raw_param.h" 23 namespace OHOS { 24 namespace HiviewDFX { 25 class DumperParameter { 26 public: 27 DumperParameter(); 28 ~DumperParameter(); 29 public: 30 void SetOpts(const DumperOpts &opts); 31 const DumperOpts &GetOpts() const; 32 // set output file path 33 void SetOutputFilePath(std::string& path); 34 // get output file path 35 std::string& GetOutputFilePath(); 36 // set config list 37 void SetExecutorConfigList(std::vector<std::shared_ptr<DumpCfg>>& list); 38 // get config list 39 std::vector<std::shared_ptr<DumpCfg>>& GetExecutorConfigList(); 40 // set client callback 41 void setClientCallback(const std::shared_ptr<RawParam>& reqCtl); 42 // get client callback 43 std::shared_ptr<RawParam> getClientCallback(); 44 // set IPC flag 45 // check IPC flag SetUid(int uid)46 void SetUid(int uid) 47 { 48 uid_ = uid; 49 } GetUid()50 int GetUid() const 51 { 52 return uid_; 53 } SetPid(int pid)54 void SetPid(int pid) 55 { 56 pid_ = pid; 57 } GetPid()58 int GetPid() const 59 { 60 return pid_; 61 }; 62 void Dump() const; 63 private: 64 int uid_ {-1}; 65 int pid_ {-1}; 66 DumperOpts opts_; 67 std::vector<std::shared_ptr<DumpCfg>> list_; // list 68 std::shared_ptr<RawParam> mPtrReqCtl; 69 }; 70 } // namespace HiviewDFX 71 } // namespace OHOS 72 #endif // HIDUMPER_SERVICES_DUMPER_PARAMETER_H 73