On Thu, Dec 4, 2014 at 4:08 PM, Mike Holmes <[email protected]> wrote:
> Remove the following from the external API and make them internal > ODP_DBG > ODP_ERR > ODP_ABORT > > Signed-off-by: Mike Holmes <[email protected]> > Reviewed-by: Bill Fischofer <[email protected]> > --- > > Depends on [PATCH] example: test: remove use of internal ODP macros > > platform/linux-generic/include/api/odp_debug.h | 24 > ---------------------- > .../linux-generic/include/odp_debug_internal.h | 24 > ++++++++++++++++++++++ > platform/linux-generic/odp_buffer_pool.c | 2 +- > platform/linux-generic/odp_coremask.c | 2 +- > platform/linux-generic/odp_linux.c | 2 +- > platform/linux-generic/odp_packet.c | 1 + > platform/linux-generic/odp_packet_io.c | 2 +- > platform/linux-generic/odp_packet_socket.c | 1 + > platform/linux-generic/odp_queue.c | 2 +- > platform/linux-generic/odp_ring.c | 2 +- > platform/linux-generic/odp_schedule.c | 2 +- > platform/linux-generic/odp_system_info.c | 2 +- > platform/linux-generic/odp_thread.c | 2 +- > platform/linux-generic/odp_timer.c | 2 +- > 14 files changed, 36 insertions(+), 34 deletions(-) > > diff --git a/platform/linux-generic/include/api/odp_debug.h > b/platform/linux-generic/include/api/odp_debug.h > index 1f5eaff..cb2c3e9 100644 > --- a/platform/linux-generic/include/api/odp_debug.h > +++ b/platform/linux-generic/include/api/odp_debug.h > @@ -112,30 +112,6 @@ extern int odp_override_log(odp_log_level_e level, > const char *fmt, ...); > #define ODP_PRINT(fmt, ...) \ > odp_override_log(ODP_LOG_PRINT, " " fmt, ##__VA_ARGS__) > > -/** > - * Log debug message if ODP_DEBUG_PRINT flag is set. > - */ > -#define ODP_DBG(fmt, ...) \ > - do { \ > - if (ODP_DEBUG_PRINT == 1) \ > - ODP_LOG(ODP_LOG_DBG, fmt, ##__VA_ARGS__);\ > - } while (0) > - > -/** > - * Log error message. > - */ > -#define ODP_ERR(fmt, ...) \ > - ODP_LOG(ODP_LOG_ERR, fmt, ##__VA_ARGS__) > - > -/** > - * Log abort message and then stop execution (by default call abort()). > - * This function should not return. > - */ > -#define ODP_ABORT(fmt, ...) \ > - do { \ > - ODP_LOG(ODP_LOG_ABORT, fmt, ##__VA_ARGS__); \ > - abort(); \ > - } while (0) > > /** > * @} > diff --git a/platform/linux-generic/include/odp_debug_internal.h > b/platform/linux-generic/include/odp_debug_internal.h > index ee3c543..647ebde 100644 > --- a/platform/linux-generic/include/odp_debug_internal.h > +++ b/platform/linux-generic/include/odp_debug_internal.h > @@ -29,6 +29,30 @@ extern "C" { > odp_override_log(ODP_LOG_UNIMPLEMENTED, \ > "%s:%d:The function %s() is not implemented\n", \ > __FILE__, __LINE__, __func__) > +/** > + * Log debug message if ODP_DEBUG_PRINT flag is set. > + */ > +#define ODP_DBG(fmt, ...) \ > + do { \ > + if (ODP_DEBUG_PRINT == 1) \ > + ODP_LOG(ODP_LOG_DBG, fmt, ##__VA_ARGS__);\ > + } while (0) > + > +/** > + * Log error message. > + */ > +#define ODP_ERR(fmt, ...) \ > + ODP_LOG(ODP_LOG_ERR, fmt, ##__VA_ARGS__) > + > +/** > + * Log abort message and then stop execution (by default call abort()). > + * This function should not return. > + */ > +#define ODP_ABORT(fmt, ...) \ > + do { \ > + ODP_LOG(ODP_LOG_ABORT, fmt, ##__VA_ARGS__); \ > + abort(); \ > + } while (0) > > #ifdef __cplusplus > } > diff --git a/platform/linux-generic/odp_buffer_pool.c > b/platform/linux-generic/odp_buffer_pool.c > index 6a0a6b2..aaf77a3 100644 > --- a/platform/linux-generic/odp_buffer_pool.c > +++ b/platform/linux-generic/odp_buffer_pool.c > @@ -15,7 +15,7 @@ > #include <odp_internal.h> > #include <odp_config.h> > #include <odp_hints.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > > #include <string.h> > #include <stdlib.h> > diff --git a/platform/linux-generic/odp_coremask.c > b/platform/linux-generic/odp_coremask.c > index c7438cc..54cd333 100644 > --- a/platform/linux-generic/odp_coremask.c > +++ b/platform/linux-generic/odp_coremask.c > @@ -5,7 +5,7 @@ > */ > > #include <odp_coremask.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > > #include <stdlib.h> > #include <string.h> > diff --git a/platform/linux-generic/odp_linux.c > b/platform/linux-generic/odp_linux.c > index 11f76c9..ecd77b3 100644 > --- a/platform/linux-generic/odp_linux.c > +++ b/platform/linux-generic/odp_linux.c > @@ -23,7 +23,7 @@ > #include <odp_thread.h> > #include <odp_init.h> > #include <odp_system_info.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > > > typedef struct { > diff --git a/platform/linux-generic/odp_packet.c > b/platform/linux-generic/odp_packet.c > index f8fd8ef..a1bf18e 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -6,6 +6,7 @@ > > #include <odp_packet.h> > #include <odp_packet_internal.h> > +#include <odp_debug_internal.h> > #include <odp_hints.h> > #include <odp_byteorder.h> > > diff --git a/platform/linux-generic/odp_packet_io.c > b/platform/linux-generic/odp_packet_io.c > index 706a3cc..7e3eca2 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -17,7 +17,7 @@ > #include <odp_config.h> > #include <odp_queue_internal.h> > #include <odp_schedule_internal.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > > #include <string.h> > #include <sys/ioctl.h> > diff --git a/platform/linux-generic/odp_packet_socket.c > b/platform/linux-generic/odp_packet_socket.c > index 68983eb..d70a674 100644 > --- a/platform/linux-generic/odp_packet_socket.c > +++ b/platform/linux-generic/odp_packet_socket.c > @@ -36,6 +36,7 @@ > > #include <odp_packet_socket.h> > #include <odp_packet_internal.h> > +#include <odp_debug_internal.h> > #include <odp_hints.h> > > #include <odph_eth.h> > diff --git a/platform/linux-generic/odp_queue.c > b/platform/linux-generic/odp_queue.c > index 1318bcd..c278094 100644 > --- a/platform/linux-generic/odp_queue.c > +++ b/platform/linux-generic/odp_queue.c > @@ -17,7 +17,7 @@ > #include <odp_config.h> > #include <odp_packet_io_internal.h> > #include <odp_packet_io_queue.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > #include <odp_hints.h> > #include <odp_sync.h> > > diff --git a/platform/linux-generic/odp_ring.c > b/platform/linux-generic/odp_ring.c > index 1d3130a..66e1631 100644 > --- a/platform/linux-generic/odp_ring.c > +++ b/platform/linux-generic/odp_ring.c > @@ -78,7 +78,7 @@ > #include <fcntl.h> > #include <stdio.h> > #include <string.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > #include <odp_rwlock.h> > #include <odph_ring.h> > > diff --git a/platform/linux-generic/odp_schedule.c > b/platform/linux-generic/odp_schedule.c > index cc84e11..7c09c23 100644 > --- a/platform/linux-generic/odp_schedule.c > +++ b/platform/linux-generic/odp_schedule.c > @@ -13,7 +13,7 @@ > #include <odp_buffer_pool.h> > #include <odp_internal.h> > #include <odp_config.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > #include <odp_thread.h> > #include <odp_time.h> > #include <odp_spinlock.h> > diff --git a/platform/linux-generic/odp_system_info.c > b/platform/linux-generic/odp_system_info.c > index 10665bb..7d18573 100644 > --- a/platform/linux-generic/odp_system_info.c > +++ b/platform/linux-generic/odp_system_info.c > @@ -6,7 +6,7 @@ > > #include <odp_system_info.h> > #include <odp_internal.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > #include <odp_align.h> > #include <string.h> > #include <stdio.h> > diff --git a/platform/linux-generic/odp_thread.c > b/platform/linux-generic/odp_thread.c > index dcb893d..faa12a2 100644 > --- a/platform/linux-generic/odp_thread.c > +++ b/platform/linux-generic/odp_thread.c > @@ -13,7 +13,7 @@ > #include <odp_internal.h> > #include <odp_atomic.h> > #include <odp_config.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > #include <odp_shared_memory.h> > #include <odp_align.h> > > diff --git a/platform/linux-generic/odp_timer.c > b/platform/linux-generic/odp_timer.c > index 313c713..a4fef58 100644 > --- a/platform/linux-generic/odp_timer.c > +++ b/platform/linux-generic/odp_timer.c > @@ -12,7 +12,7 @@ > #include <odp_atomic.h> > #include <odp_spinlock.h> > #include <odp_sync.h> > -#include <odp_debug.h> > +#include <odp_debug_internal.h> > > #include <signal.h> > #include <time.h> > -- > 2.1.0 > > > _______________________________________________ > lng-odp mailing list > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
