mbox series

[0/8] connection: Improve Connection Gateway Debugging and Documentation

Message ID 20231128230847.1224497-1-gerickson@nuovations.com (mailing list archive)
Headers show
Series connection: Improve Connection Gateway Debugging and Documentation | expand

Message

Grant Erickson Nov. 28, 2023, 11:08 p.m. UTC
This improves connection gateway debugging with the following changes:

    * This introduces and leverages two functions
      'gateway_{config,data}_debug' to conditionally log gateway data and
      configuration at the debug level.

    * Expands, exhances, and refactors 'DBG' statements throughout the
      module to improve symmetry in content, aid in debugging, and to
      reflect the newly-leveraged 'GATEWAY_CONFIG_DBG' and
      'GATEWAY_DATA_DBG' macro which, in turn, are wrappers around
      'gateway_{config,data}_debug'.

In addition, this adds to or expands on function- and body-level
documentation for:

    * connection_{add,del}gateway
    * __connman_connection_gateway_{add,remove}
    * __connman_connection_update_gateway

The aforementioned 'GATEWAY_CONFIG_DBG' and 'GATEWAY_DATA_DBG' are
supported by log module changes, including:

    * Introduces 'CONNMAN_DEBUG_DESC_INSTANTIATE' which declares and
      instantiates an instance of 'connmand_debug_desc'.

    * Replaces 'CONNMAN_DEBUG_DEFINE' with 'CONNMAN_DEBUG_ALIAS' which
      declares and instantiates an alias (that is, asserts the
      'CONNMAN_DEBUG_FLAG_ALIAS' flag) instance of
      'connmand_debug_desc', using 'CONNMAN_DEBUG_DESC_INSTANTIATE'.

    * Introduces 'CONNMAN_DEBUG' which declares and instantiates an
      instance of 'connmand_debug_desc', again using
      'CONNMAN_DEBUG_DESC_INSTANTIATE', for controlling an invocation
      of 'connman_debug' with it that includes both the file and
      function name the macro was invoked in or attributed to.

      - The key difference between this and 'DBG' is that this allows
        the caller to specify the function string rather than relying on
        '__FUNCTION__'.

    * Redefines 'DBG' against 'CONNMAN_DEBUG' with '__func__' as the
      function parameter.

Grant Erickson (8):
  log: Refactor debugging preprocessor macros.
  log: Document debugging preprocessor macros.
  connection: Introduce and leverage 'gateway_{config,data}_debug'.
  connection: Document 'gateway_{config,data}_debug'.
  connection: Expand, Enhance, and Refactor 'DBG'.
  connection: Document 'connection_{add,del}gateway'.
  connection: Document '__connman_connection_gateway_{add,remove}'.
  connection: Document '__connman_connection_update_gateway'.

 include/log.h    | 141 ++++++++++++++---
 src/connection.c | 390 +++++++++++++++++++++++++++++++++++++++++++++--
 src/log.c        |   2 +-
 3 files changed, 502 insertions(+), 31 deletions(-)

Comments

Grant Erickson Nov. 29, 2023, 7:20 p.m. UTC | #1
This improves connection gateway debugging with the following changes:

    * This introduces and leverages two functions
      'gateway_{config,data}_debug' to conditionally log gateway data and
      configuration at the debug level.

    * Expands, exhances, and refactors 'DBG' statements throughout the
      module to improve symmetry in content, aid in debugging, and to
      reflect the newly-leveraged 'GATEWAY_CONFIG_DBG' and
      'GATEWAY_DATA_DBG' macro which, in turn, are wrappers around
      'gateway_{config,data}_debug'.

In addition, this adds to or expands on function- and body-level
documentation for:

    * connection_{add,del}gateway
    * __connman_connection_gateway_{add,remove}
    * __connman_connection_update_gateway

The aforementioned 'GATEWAY_CONFIG_DBG' and 'GATEWAY_DATA_DBG' are
supported by log module changes, including:

    * Introduces 'CONNMAN_DEBUG_DESC_INSTANTIATE' which declares and
      instantiates an instance of 'connman_debug_desc'.

    * Replaces 'CONNMAN_DEBUG_DEFINE' with 'CONNMAN_DEBUG_ALIAS' which
      declares and instantiates an alias (that is, asserts the
      'CONNMAN_DEBUG_FLAG_ALIAS' flag) instance of
      'connmand_debug_desc', using 'CONNMAN_DEBUG_DESC_INSTANTIATE'.

    * Redefines 'DBG' against 'CONNMAN_DEBUG_DESC_INSTANTIATE' with
      '__func__' as the function parameter.

Grant Erickson (8):
  log: Refactor debugging preprocessor macros.
  log: Document debugging preprocessor macros.
  connection: Introduce and leverage 'gateway_{config,data}_debug'.
  connection: Document 'gateway_{config,data}_debug'.
  connection: Expand, Enhance, and Refactor 'DBG'.
  connection: Document 'connection_{add,del}gateway'.
  connection: Document '__connman_connection_gateway_{add,remove}'.
  connection: Document '__connman_connection_update_gateway'.

 include/log.h    |  99 +++++++++---
 src/connection.c | 390 +++++++++++++++++++++++++++++++++++++++++++++--
 src/log.c        |   2 +-
 3 files changed, 461 insertions(+), 30 deletions(-)