diff mbox

api: move internal debug macros

Message ID 1417730884-42082-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit f158b205eb5316465bf2441e4b93e9e0adb5521f
Headers show

Commit Message

Mike Holmes Dec. 4, 2014, 10:08 p.m. UTC
Remove the following from the external API and make them internal
ODP_DBG
ODP_ERR
ODP_ABORT

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---

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(-)

Comments

Bill Fischofer Dec. 4, 2014, 10:12 p.m. UTC | #1
On Thu, Dec 4, 2014 at 4:08 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Remove the following from the external API and make them internal
> ODP_DBG
> ODP_ERR
> ODP_ABORT
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>
> 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
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Dec. 5, 2014, 7:25 a.m. UTC | #2
Merged,
Maxim.

On 12/05/2014 01:12 AM, Bill Fischofer wrote:
>
>
> On Thu, Dec 4, 2014 at 4:08 PM, Mike Holmes <mike.holmes@linaro.org 
> <mailto:mike.holmes@linaro.org>> wrote:
>
>     Remove the following from the external API and make them internal
>     ODP_DBG
>     ODP_ERR
>     ODP_ABORT
>
>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>
>     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
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Taras Kondratiuk Dec. 5, 2014, 8:53 a.m. UTC | #3
On 12/05/2014 09:25 AM, Maxim Uvarov wrote:
> Merged,
> Maxim.

Guys you are too quick in merging this. Most of us even didn't have
a chance to look at some of patches merged tonight.

>
> On 12/05/2014 01:12 AM, Bill Fischofer wrote:
>>
>>
>> On Thu, Dec 4, 2014 at 4:08 PM, Mike Holmes <mike.holmes@linaro.org
>> <mailto:mike.holmes@linaro.org>> wrote:
>>
>>     Remove the following from the external API and make them internal
>>     ODP_DBG
>>     ODP_ERR
>>     ODP_ABORT

Other macros (ODP_PRINT, ODP_LOG, ODP_ASSERT, ODP_ASSERT_STATIC) should
also be internal. Why they are not addressed in this patch?
Mike Holmes Dec. 5, 2014, 3:07 p.m. UTC | #4
They were not part of the the API Doc
<https://docs.google.com/a/linaro.org/document/d/1BRVyW8IIVMTq4nhB_vUz5y-te6TEdu5g1XgolujjY6c/edit#heading=h.98203k4q66lm>,
happy to do more if approved by Petri

On 5 December 2014 at 03:53, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:

> On 12/05/2014 09:25 AM, Maxim Uvarov wrote:
>
>> Merged,
>> Maxim.
>>
>
> Guys you are too quick in merging this. Most of us even didn't have
> a chance to look at some of patches merged tonight.
>
>
>> On 12/05/2014 01:12 AM, Bill Fischofer wrote:
>>
>>>
>>>
>>> On Thu, Dec 4, 2014 at 4:08 PM, Mike Holmes <mike.holmes@linaro.org
>>> <mailto:mike.holmes@linaro.org>> wrote:
>>>
>>>     Remove the following from the external API and make them internal
>>>     ODP_DBG
>>>     ODP_ERR
>>>     ODP_ABORT
>>>
>>
> Other macros (ODP_PRINT, ODP_LOG, ODP_ASSERT, ODP_ASSERT_STATIC) should
> also be internal. Why they are not addressed in this patch?
>
Taras Kondratiuk Dec. 5, 2014, 3:16 p.m. UTC | #5
On 12/05/2014 05:07 PM, Mike Holmes wrote:
> They were not part of the the API Doc
> <https://docs.google.com/a/linaro.org/document/d/1BRVyW8IIVMTq4nhB_vUz5y-te6TEdu5g1XgolujjY6c/edit#heading=h.98203k4q66lm>,
> happy to do more if approved by Petri

Ok I've added also ODP_ASSERT to the document.
diff mbox

Patch

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>