加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hiview_config.h 3.19 KB
一键复制 编辑 原始数据 按行查看 历史
shenchenkai 提交于 2021-04-02 17:33 . add mini hiview macro in BUILD.gn
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef HOS_LITE_HIVIEW_CONFIG_H
#define HOS_LITE_HIVIEW_CONFIG_H
#include <stdint.h>
#include "ohos_types.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */
/* Set the following parameters for different products based on their own resources. */
#define HIVIEW_FILE_DIR ""
/* file path config */
#define HIVIEW_FILE_PATH_LOG HIVIEW_FILE_DIR"debug.log"
#define HIVIEW_FILE_PATH_FAULT_EVENT HIVIEW_FILE_DIR"fault.event"
#define HIVIEW_FILE_PATH_UE_EVENT HIVIEW_FILE_DIR"ue.event"
#define HIVIEW_FILE_PATH_STAT_EVENT HIVIEW_FILE_DIR"stat.event"
#define HIVIEW_FILE_PATH_DUMP HIVIEW_FILE_DIR"dump.dat"
/* cache size config */
#define LOG_STATIC_CACHE_SIZE 1024 /* Must be greater than HIVIEW_FILE_BUF_SIZE. */
#define EVENT_CACHE_SIZE 256 /* Must be greater than HIVIEW_FILE_BUF_SIZE. */
#define JS_LOG_CACHE_SIZE 512
#define HIVIEW_FILE_BUF_SIZE 128
/* RAM dump config */
#define HIVIEW_DUMP_PRE_SIZE (384 * 1024)
#define HIVIEW_DUMP_HEADER_OFFSET 0x400
#define HIVIEW_DUMP_RAM_ADDR 0x10000400 /* 10000000 ~ 100003FF reserved for NVIC, no need save */
#define HIVIEW_DUMP_RAM_SIZE (HIVIEW_DUMP_PRE_SIZE - HIVIEW_DUMP_HEADER_OFFSET)
/* feature switch */
#define HIVIEW_FEATURE_ON 1
#define HIVIEW_FEATURE_OFF 0
#pragma pack(1)
typedef struct {
const uint8 outputOption : 4; /* Control log output mode. Cannot be modified during running. */
uint8 hiviewInited : 1; /* Indicates whether the hiview service is inited. */
uint8 level : 3; /* Control log output level. HILOG_LV_XXX */
uint8 logSwitch : 1; /* Indicates whether to enable the log component. */
uint8 eventSwitch : 1; /* Indicates whether to enable the event component. */
uint8 dumpSwitch : 1; /* Indicates whether to enable the dump component. */
uint64 logOutputModule; /* Control log output module. */
uint16 writeFailureCount;
} HiviewConfig;
#pragma pack()
typedef enum {
OUTPUT_OPTION_DEBUG = 0, /* Output to the UART without buffer. Commercial versions are forbidden. */
OUTPUT_OPTION_FLOW, /* Output to UART via SAMR */
OUTPUT_OPTION_TEXT_FILE,
OUTPUT_OPTION_BIN_FILE,
OUTPUT_OPTION_MAX
} HiviewOutputOption;
extern HiviewConfig g_hiviewConfig;
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */
#endif /* End of #ifndef HOS_LITE_HIVIEW_CONFIG_H */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化