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 HIVIEW_PLATFORM_MANAGEMENT_INFO_EXPORT_SERVICE_H 16 #define HIVIEW_PLATFORM_MANAGEMENT_INFO_EXPORT_SERVICE_H 17 #include <cstdint> 18 #include <memory> 19 #include <string> 20 #include <vector> 21 22 #include "audit_log_parser.h" 23 namespace OHOS { 24 namespace HiviewDFX { 25 class HiviewService { 26 public: HiviewService()27 HiviewService() : parser_(nullptr){}; ~HiviewService()28 ~HiviewService(){}; 29 void StartService(); 30 // Dump interface 31 void DumpRequestDispatcher(int fd, const std::vector<std::string>& cmds); 32 private: 33 void DumpDetailedInfo(int fd); 34 void DumpPluginInfo(int fd, const std::vector<std::string>& cmds) const; 35 void DumpLoadedPluginInfo(int fd) const; 36 void DumpPluginUsageInfo(int fd); 37 void DumpPluginUsageInfo(int fd, const std::string& pluginName) const; 38 39 void DumpThreadUsageInfo(int fd) const; 40 void DumpThreadUsageInfo(int fd, const std::string& threadName) const; 41 42 void DumpPipelineUsageInfo(int fd) const; 43 void DumpPipelineUsageInfo(int fd, const std::string& pipelineName) const; 44 45 void PrintUsage(int fd) const; 46 std::unique_ptr<AuditLogParser> parser_; 47 }; 48 } // namespace HiviewDFX 49 } // namespace OHOS 50 #endif // HIVIEW_PLATFORM_MANAGEMENT_INFO_EXPORT_SERVICE_H 51