aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2014-11-19 18:14:17 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-11-21 14:59:21 +0300
commit7c671645c1478dcabc2288c7d736e5bca4888037 (patch)
tree0729f19c2c5701e5e003047af7c1712221842292 /platform/linux-generic/include
parent722db81b51a9ff9510052ac6b86e01d99fe76cef (diff)
linux-generic: Replace printf with ODP_PRINT
Current ODP APIs that print internal data on demand for the application do so via printf. Introduce ODP_PRI so that APIs that produce output may be channeled though ODP_LOG to match the other logging types. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include')
-rw-r--r--platform/linux-generic/include/api/odp_debug.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h
index c9b2edd66..5c3adde85 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -76,7 +76,8 @@ typedef enum odp_log_level {
ODP_LOG_DBG,
ODP_LOG_ERR,
ODP_LOG_UNIMPLEMENTED,
- ODP_LOG_ABORT
+ ODP_LOG_ABORT,
+ ODP_LOG_PRINT
} odp_log_level_e;
/**
@@ -94,6 +95,10 @@ do { \
fprintf(stderr, "%s:%d:%s():" fmt, __FILE__, \
__LINE__, __func__, ##__VA_ARGS__); \
break; \
+ case ODP_LOG_PRINT: \
+ fprintf(stdout, "%s:%d:%s():" fmt, __FILE__, \
+ __LINE__, __func__, ##__VA_ARGS__); \
+ break; \
case ODP_LOG_ABORT: \
fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \
__LINE__, __func__, ##__VA_ARGS__); \
@@ -111,6 +116,13 @@ do { \
} while (0)
/**
+ * Printing macro, which prints output when the application
+ * calls one of the ODP APIs specifically for dumping internal data.
+ */
+#define ODP_PRINT(fmt, ...) \
+ ODP_LOG(ODP_LOG_PRINT, fmt, ##__VA_ARGS__)
+
+/**
* Debug printing macro, which prints output when DEBUG flag is set.
*/
#define ODP_DBG(fmt, ...) \