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 HIVIEWDFX_HIVIEW_FAULTLOGGER_PLUGIN_H 16 #define HIVIEWDFX_HIVIEW_FAULTLOGGER_PLUGIN_H 17 #include <cstdint> 18 #include <ctime> 19 #include <memory> 20 #include <string> 21 22 #include "faultlog_info.h" 23 #include "faultlog_query_result_inner.h" 24 #include "plugin.h" 25 26 namespace OHOS { 27 namespace HiviewDFX { 28 constexpr char FAULTLOGGER_PLUGIN_NAME[] = "Faultlogger"; 29 class FaultloggerPlugin : public Plugin { 30 public: 31 FaultloggerPlugin() = default; ~FaultloggerPlugin()32 virtual ~FaultloggerPlugin(){}; 33 34 // faultlogger interfaces 35 // Add log for specific fault type AddFaultLog(FaultLogInfo & info)36 virtual void AddFaultLog(FaultLogInfo& info){}; 37 38 // Get FaultlogInfo from file GetFaultLogInfo(const std::string & logPath)39 virtual std::unique_ptr<FaultLogInfo> GetFaultLogInfo(const std::string& logPath) 40 { 41 return nullptr; 42 }; 43 44 // Query self fault log QuerySelfFaultLog(int32_t uid,int32_t pid,int32_t faultType,int32_t maxNum)45 virtual std::unique_ptr<FaultLogQueryResultInner> QuerySelfFaultLog(int32_t uid, int32_t pid, 46 int32_t faultType, int32_t maxNum) 47 { 48 return nullptr; 49 }; 50 }; 51 } // namespace HiviewDFX 52 } // namespace OHOS 53 #endif 54