1 /* 2 * Copyright (c) 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 16 #ifndef HIVIEW_BASE_EVENT_REPORT_HIVIEW_EVENT_COMMON_H 17 #define HIVIEW_BASE_EVENT_REPORT_HIVIEW_EVENT_COMMON_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace HiviewDFX { 23 constexpr unsigned int LABEL_DOMAIN = 0xD002D10; 24 const std::string EVENT_DOMAIN = "HIVIEWDFX"; 25 26 namespace BaseEventSpace { 27 const std::string KEY_OF_DOMAIN = "domain_"; 28 const std::string KEY_OF_NAME = "name_"; 29 const std::string KEY_OF_TYPE = "type_"; 30 } 31 32 namespace PluginEventSpace { 33 const std::string LOAD_EVENT_NAME = "PLUGIN_LOAD"; 34 const std::string UNLOAD_EVENT_NAME = "PLUGIN_UNLOAD"; 35 const std::string KEY_OF_PLUGIN_NAME = "NAME"; 36 const std::string KEY_OF_RESULT = "RESULT"; 37 constexpr uint32_t LOAD_SUCCESS = 0; 38 constexpr uint32_t LOAD_DUPLICATE_NAME = 1; 39 constexpr uint32_t LOAD_UNREGISTERED = 2; 40 constexpr uint32_t UNLOAD_SUCCESS = 0; 41 constexpr uint32_t UNLOAD_INVALID = 1; 42 constexpr uint32_t UNLOAD_NOT_FOUND = 2; 43 constexpr uint32_t UNLOAD_IN_USE = 3; 44 } 45 46 namespace PluginFaultEventSpace { 47 const std::string EVENT_NAME = "PLUGIN_FAULT"; 48 const std::string KEY_OF_PLUGIN_NAME = "NAME"; 49 const std::string KEY_OF_REASON = "REASON"; 50 } 51 52 namespace PluginStatsEventSpace { 53 const std::string EVENT_NAME = "PLUGIN_STATS"; 54 const std::string KEY_OF_PLUGIN_NAME = "NAME"; 55 const std::string KEY_OF_AVG_TIME = "AVG_TIME"; 56 const std::string KEY_OF_TOP_K_TIME = "TOP_K_TIME"; 57 const std::string KEY_OF_TOP_K_EVENT = "TOP_K_EVENT"; 58 const std::string KEY_OF_TOTAL = "TOTAL"; 59 const std::string KEY_OF_PROC_NAME = "PROC_NAME"; 60 const std::string KEY_OF_PROC_TIME = "PROC_TIME"; 61 const std::string KEY_OF_TOTAL_TIME = "TOTAL_TIME"; 62 } 63 } // namespace HiviewDFX 64 } // namespace OHOS 65 #endif // HIVIEW_BASE_EVENT_REPORT_HIVIEW_EVENT_COMMON_H 66