mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-31 16:37:07 +00:00
tools: acrn-crashlog: framework of acrn-crashlog
This is the first patch of acrn-crashlog. This patch initializes the framework of acrn-crashlog: acrnprobe, common, data, and usercrash. And it initializes the Makefile for each part. Signed-off-by: Liu Xinwu <xinwu.liu@intel.com> Signed-off-by: CHEN Gang <gang.c.chen@intel.com> Reviewed-by: Zhang Yanmin <yanmin.zhang@intel.com> Reviewed-by: Liu Chuansheng <chuansheng.liu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
47
tools/acrn-crashlog/common/include/log_sys.h
Normal file
47
tools/acrn-crashlog/common/include/log_sys.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef __LOG_SYS_H__
|
||||
#define __LOG_SYS_H__
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <syslog.h>
|
||||
|
||||
void do_log(int level,
|
||||
#ifdef DEBUG_ACRN_CRASHLOG
|
||||
const char *func, int line,
|
||||
#endif
|
||||
...);
|
||||
|
||||
#define MAX_LOG_LEN 1024
|
||||
#define LOG_LEVEL LOG_WARNING
|
||||
|
||||
#ifdef DEBUG_ACRN_CRASHLOG
|
||||
#define LOGE(...) \
|
||||
do_log(LOG_ERR, __func__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#define LOGW(...) \
|
||||
do_log(LOG_WARNING, __func__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#define LOGI(...) \
|
||||
do_log(LOG_INFO, __func__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#define LOGD(...) \
|
||||
do_log(LOG_DEBUG, __func__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define LOGE(...) \
|
||||
do_log(LOG_ERR, __VA_ARGS__)
|
||||
|
||||
#define LOGW(...) \
|
||||
do_log(LOG_WARNING, __VA_ARGS__)
|
||||
|
||||
#define LOGI(...) \
|
||||
do_log(LOG_INFO, __VA_ARGS__)
|
||||
|
||||
#define LOGD(...) \
|
||||
do_log(LOG_DEBUG, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user