1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/* Copyright (c) 2014-2018, Linaro Limited
* Copyright (c) 2020-2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file
*
* ODP Debug internal
* This file contains implementer support functions for Debug capabilities.
*
* @warning These definitions are not part of ODP API, they are for
* internal use by implementers and should not be called from any other scope.
*/
#ifndef ODP_DEBUG_INTERNAL_H_
#define ODP_DEBUG_INTERNAL_H_
#include <odp/autoheader_external.h>
#include <odp/api/debug.h>
#include <odp/api/plat/debug_inlines.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Avoid "ISO C99 requires at least one argument for the "..." in a variadic
* macro" errors when building with 'pedantic' option. */
#pragma GCC system_header
/* Debug level configure option. Zero is the highest level. Value of N prints debug messages from
* level 0 to N. */
#define CONFIG_DEBUG_LEVEL 0
/**
* This macro is used to indicate when a given function is not implemented
*/
#define ODP_UNIMPLEMENTED() \
_ODP_LOG_FN(ODP_LOG_UNIMPLEMENTED, \
"%s:%d:The function %s() is not implemented\n", \
__FILE__, __LINE__, __func__)
/*
* Print debug message to log, if ODP_DEBUG_PRINT flag is set and CONFIG_DEBUG_LEVEL is high enough.
*/
#define ODP_DBG_LVL(level, fmt, ...) \
do { \
if (ODP_DEBUG_PRINT == 1 && CONFIG_DEBUG_LEVEL >= (level)) \
_ODP_LOG(ODP_LOG_DBG, fmt, ##__VA_ARGS__);\
} while (0)
/*
* Same as ODP_DBG_LVL() but does not add file/line/function name prefix
*/
#define ODP_DBG_RAW(level, fmt, ...) \
do { \
if (ODP_DEBUG_PRINT == 1 && CONFIG_DEBUG_LEVEL >= (level)) \
_ODP_LOG_FN(ODP_LOG_DBG, fmt, ##__VA_ARGS__);\
} while (0)
#ifdef __cplusplus
}
#endif
#endif
|