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.

106 lines
3.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef DFT_JANK_H
#define DFT_JANK_H
#include "dft_common.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/* *
* brief print jank log. CNcomment: 上报事件。CNend
* attention \n
* NA.
* param[in] prio log priority. CNcomment: 日志优先级。 CNend
* param[in] tag log tag. CNcomment: 日志tag头文件jank_tag_constant.h中定义。 CNend
* param[in] fmt formate string. CNcomment: 格式字符串。 CNend
* param[in] ... variable parameter list. CNcomment: 可变参数列表。 CNend
* retval ::SUCCESS success. CNcomment: 成功。 CNend
* retval ::FAILURE failure. CNcomment: 失败。 CNend
* see \n
* NA.
*/
int dft_jank_print(short prio, short tag, const char *fmt, ...);
/* *
* brief print jank log. CNcomment: 上报事件。CNend
* attention \n
* NA.
* param[in] prio log priority. CNcomment: 日志优先级。 CNend
* param[in] tag log tag. CNcomment: 日志tag头文件jank_tag_constant.h中定义。 CNend
* param[in] ut up time. CNcomment: 自启动后的运行时间。 CNend
* param[in] rt real time. CNcomment: 自开机以来的时间。 CNend
* param[in] fmt formate string. CNcomment: 格式字符串。 CNend
* param[in] ... variable parameter list. CNcomment: 可变参数列表。 CNend
* retval ::SUCCESS success. CNcomment: 成功。 CNend
* retval ::FAILURE failure. CNcomment: 失败。 CNend
* see \n
* NA.
*/
int dft_jank_chgtm_print(short prio, short tag, unsigned long ut, unsigned long rt, const char *fmt, ...);
/*
* Simplified macro to send a jank log message using the current LOG_TAG.
*/
#ifndef JLOGD
#define JLOGD(tag, ...) ((void)dft_jank_print(DFTEVENT_PRIORITY_DEBUG, tag, __VA_ARGS__))
#endif
#ifndef JLOGV
#define JLOGV(tag, ...) ((void)dft_jank_print(DFTEVENT_PRIORITY_VERBOSE, tag, __VA_ARGS__))
#endif
#ifndef JLOGW
#define JLOGW(tag, ...) ((void)dft_jank_print(DFTEVENT_PRIORITY_WARN, tag, __VA_ARGS__))
#endif
#ifndef JLOGI
#define JLOGI(tag, ...) ((void)dft_jank_print(DFTEVENT_PRIORITY_INFO, tag, __VA_ARGS__))
#endif
#ifndef JLOGE
#define JLOGE(tag, ...) ((void)dft_jank_print(DFTEVENT_PRIORITY_ERROR, tag, __VA_ARGS__))
#endif
#ifndef JLOGD_CHGTM
#define JLOGD_CHGTM(tag, ut, rt, ...) ((void)dft_jank_chgtm_print(DFTEVENT_PRIORITY_DEBUG, tag, ut, rt, __VA_ARGS__))
#endif
#ifndef CONDITION
#define CONDITION(cond) (__builtin_expect((cond) != 0, 0))
#endif
#ifndef JLOGD_IF
#define JLOGD_IF(cond, tag, ...) \
((CONDITION(cond)) ? ((void)dft_jank_print(DFTEVENT_PRIORITY_DEBUG, tag, __VA_ARGS__)) : (void)0)
#endif
#ifndef JLOGV_IF
#define JLOGV_IF(cond, tag, ...) \
((CONDITION(cond)) ? ((void)dft_jank_print(DFTEVENT_PRIORITY_VERBOSE, tag, __VA_ARGS__)) : (void)0)
#endif
#ifndef JLOGW_IF
#define JLOGW_IF(cond, tag, ...) \
((CONDITION(cond)) ? ((void)dft_jank_print(DFTEVENT_PRIORITY_WARN, tag, __VA_ARGS__)) : (void)0)
#endif
#ifndef JLOGI_IF
#define JLOGI_IF(cond, tag, ...) \
((CONDITION(cond)) ? ((void)dft_jank_print(DFTEVENT_PRIORITY_INFO, tag, __VA_ARGS__)) : (void)0)
#endif
#ifndef JLOGE_IF
#define JLOGE_IF(cond, tag, ...) \
((CONDITION(cond)) ? ((void)dft_jank_print(DFTEVENT_PRIORITY_ERROR, tag, __VA_ARGS__)) : (void)0)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif