1 /* 2 * Copyright (c) 2020 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 HOS_LITE_HIVIEW_DEF_H 17 #define HOS_LITE_HIVIEW_DEF_H 18 19 #include "ohos_types.h" 20 21 #ifdef __cplusplus 22 #if __cplusplus 23 extern "C" { 24 #endif 25 #endif /* End of #ifdef __cplusplus */ 26 27 #define HIVIEW_SERVICE "hiview" 28 #define LOG_INFO_HEAD 0xEC 29 #define EVENT_INFO_HEAD 0xEA 30 #define MS_PER_SECOND 1000 31 #define SECONDS_PER_DAY 86400 32 #define SECONDS_PER_HOUR 3600 33 #define SECONDS_PER_MINUTE 60 34 #define LOG_FMT_MAX_LEN 128 35 #define LOG_CONTENT_MAX_LEN 96 36 #define LOG_MODULE_NAME_LEN 16 37 #define LOG_TIME_STR_SIZE 10 38 #define TAIL_LINE_BREAK 2 39 #define READ_FILE_BUF_MAX_SIZE 1024 40 41 #pragma pack(1) 42 typedef struct { 43 uint8 id; 44 const char *name; /* LOG_MODULE_NAME_LEN */ 45 } HiLogModuleInfo; 46 #pragma pack() 47 48 typedef struct { 49 uint8 last : 1; /* Indicates whether the last parameter. */ 50 uint8 id : 4; 51 uint8 len : 3; 52 } HiEventTag; 53 54 #ifdef __cplusplus 55 #if __cplusplus 56 } 57 #endif 58 #endif /* End of #ifdef __cplusplus */ 59 60 #endif /* End of #ifndef HOS_LITE_HIVIEW_DEF_H */ 61