You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
5.7 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2020-2020. All rights reserved.
* Description: Definition required for logcat version slog
* Author: Hisilicon
* Create: 2020-10-9
*/
#ifndef ANDROID_SLOG_H
#define ANDROID_SLOG_H
#include "slog.h"
#define MOUDLE_NAME_ID_LEVEL_MAP(x, y) \
{ \
#x, x, y \
}
enum { // use as constant
SLOG_LEVEL_DEBUG,
SLOG_LEVEL_INFO,
SLOG_LEVEL_WARN,
SLOG_LEVEL_ERROR,
SLOG_LEVEL_NULL,
SLOG_INVALID_LEVEL
};
enum {
LOG_MIN_LEVEL = SLOG_LEVEL_DEBUG,
LOG_MAX_LEVEL = SLOG_LEVEL_NULL
};
typedef struct tagModuleInfo {
const char *moduleName;
const int moduleId;
int moduleLevel;
} ModuleInfo;
constexpr int TRUE = 1;
constexpr int FALSE = 0;
constexpr int INITED = 1;
constexpr int NO_INITED = 0;
constexpr int MODULE_INIT_LOG_LEVEL = 5;
constexpr int MODULE_DEFAULT_LOG_LEVEL = DLOG_INFO;
constexpr int GLOABLE_DEFAULT_LOG_LEVEL = DLOG_ERROR;
constexpr int SYS_OK = 0;
constexpr int SYS_ERROR = -1;
constexpr int INVALID = -1;
int g_globalLogLevel = GLOABLE_DEFAULT_LOG_LEVEL;
int g_enableEvent = TRUE;
int g_logCtrlSwitch = FALSE;
int g_logCtrlLevel = GLOABLE_DEFAULT_LOG_LEVEL;
ModuleInfo g_moduleInfo[] = {
MOUDLE_NAME_ID_LEVEL_MAP(SLOG, MODULE_INIT_LOG_LEVEL), // Slog
MOUDLE_NAME_ID_LEVEL_MAP(IDEDD, MODULE_INIT_LOG_LEVEL), // ascend debug device agent
MOUDLE_NAME_ID_LEVEL_MAP(IDEDH, MODULE_INIT_LOG_LEVEL), // ascend debug agent
MOUDLE_NAME_ID_LEVEL_MAP(HCCL, MODULE_INIT_LOG_LEVEL), // HCCL
MOUDLE_NAME_ID_LEVEL_MAP(FMK, MODULE_INIT_LOG_LEVEL), // Framework
MOUDLE_NAME_ID_LEVEL_MAP(HLAIENGINE, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(DVPP, MODULE_INIT_LOG_LEVEL), // DVPP
MOUDLE_NAME_ID_LEVEL_MAP(RUNTIME, MODULE_INIT_LOG_LEVEL), // Runtime
MOUDLE_NAME_ID_LEVEL_MAP(CCE, MODULE_INIT_LOG_LEVEL), // CCE
#if (OS_TYPE_DEF == LINUX)
MOUDLE_NAME_ID_LEVEL_MAP(HDC, MODULE_INIT_LOG_LEVEL), // HDC
#else
MOUDLE_NAME_ID_LEVEL_MAP(HDCL, MODULE_INIT_LOG_LEVEL), // HDCL
#endif
MOUDLE_NAME_ID_LEVEL_MAP(DRV, MODULE_INIT_LOG_LEVEL), // Driver
MOUDLE_NAME_ID_LEVEL_MAP(MDCFUSION, MODULE_INIT_LOG_LEVEL), // Mdc fusion
MOUDLE_NAME_ID_LEVEL_MAP(MDCLOCATION, MODULE_INIT_LOG_LEVEL), // Mdc location
MOUDLE_NAME_ID_LEVEL_MAP(MDCPERCEPTION, MODULE_INIT_LOG_LEVEL), // Mdc perception
MOUDLE_NAME_ID_LEVEL_MAP(MDCFSM, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MDCCOMMON, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MDCMONITOR, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MDCBSWP, MODULE_INIT_LOG_LEVEL), // MDC basesoftware platform
MOUDLE_NAME_ID_LEVEL_MAP(MDCDEFAULT, MODULE_INIT_LOG_LEVEL), // MDC UNDEFINE
MOUDLE_NAME_ID_LEVEL_MAP(MDCSC, MODULE_INIT_LOG_LEVEL), // MDC spatial cognition
MOUDLE_NAME_ID_LEVEL_MAP(MDCPNC, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MLL, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(DEVMM, MODULE_INIT_LOG_LEVEL), // Dlog memory managent
MOUDLE_NAME_ID_LEVEL_MAP(KERNEL, MODULE_INIT_LOG_LEVEL), // Kernel
MOUDLE_NAME_ID_LEVEL_MAP(LIBMEDIA, MODULE_INIT_LOG_LEVEL), // Libmedia
MOUDLE_NAME_ID_LEVEL_MAP(CCECPU, MODULE_INIT_LOG_LEVEL), // ai cpu
MOUDLE_NAME_ID_LEVEL_MAP(ASCENDDK, MODULE_INIT_LOG_LEVEL), // AscendDK
MOUDLE_NAME_ID_LEVEL_MAP(ROS, MODULE_INIT_LOG_LEVEL), // ROS
MOUDLE_NAME_ID_LEVEL_MAP(HCCP, MODULE_INIT_LOG_LEVEL), // HCCP
MOUDLE_NAME_ID_LEVEL_MAP(ROCE, MODULE_INIT_LOG_LEVEL), // RoCE
MOUDLE_NAME_ID_LEVEL_MAP(TEFUSION, MODULE_INIT_LOG_LEVEL), // TE
MOUDLE_NAME_ID_LEVEL_MAP(PROFILING, MODULE_INIT_LOG_LEVEL), // Profiling
MOUDLE_NAME_ID_LEVEL_MAP(DP, MODULE_INIT_LOG_LEVEL), // Data Preprocess
MOUDLE_NAME_ID_LEVEL_MAP(APP, MODULE_INIT_LOG_LEVEL), // User Application call HLAI_ENGINE_LOG
MOUDLE_NAME_ID_LEVEL_MAP(TS, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(TSDUMP, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(AICPU, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(LP, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(TDT, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(FE, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MD, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MB, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(ME, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(IMU, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(IMP, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(GE, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MDCFUSA, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(CAMERA, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(ASCENDCL, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(TEEOS, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(ISP, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(SIS, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(HSM, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(DSS, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(PROCMGR, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(BBOX, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(AIVECTOR, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(TBE, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(FV, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(MDCMAP, MODULE_INIT_LOG_LEVEL),
MOUDLE_NAME_ID_LEVEL_MAP(TUNE, MODULE_INIT_LOG_LEVEL),
{
nullptr, -1, -1
}
};
#endif // ANDROID_SLOG_H