[v2,00/17] stop using variadic argument pack extension

Message ID 1708645606-7514-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
Headers
Series stop using variadic argument pack extension |

Message

Tyler Retzlaff Feb. 22, 2024, 11:46 p.m. UTC
  RTE_LOG_LINE cannot be augmented with a prefix format and arguments
without the user of RTE_LOG_LINE using the args... and ## args compiler
extension to conditionally remove trailing comma when the macro receives
only a single argument.

Provide a new/similar macro RTE_LOG_LINE_PREFIX that accepts the prefix
format and arguments as separate parameters allowing them to be expanded
at the correct locations inside of RTE_FMT() allowing the rest of the
non-prefix format string and arguments to be collapsed to the argument
pack which can be directly forwarded with __VA_ARGS__ avoiding the need
for conditional comma removal.

I've done my best to manually check expansions (preprocessed) and compiled
printf of the logs to validate correct output.

note: due to drastic change in series i have not carried any series acks
      forward.

v2:
    * revamp entire series to be ISO C99 compliant, stop using variadic
      argument pack extension.

Tyler Retzlaff (17):
  log: add a per line log helper with parameterized prefix
  bpf: stop using variadic argument pack extension
  cfgfile: stop using variadic argument pack extension
  cmdline: stop using variadic argument pack extension
  compressdev: stop using variadic argument pack extension
  metrics: stop using variadic argument pack extension
  mldev: stop using variadic argument pack extension
  net: stop using variadic argument pack extension
  pdump: stop using variadic argument pack extension
  power: stop using variadic argument pack extension
  rawdev: stop using variadic argument pack extension
  rcu: stop using variadic argument pack extension
  stack: stop using variadic argument pack extension
  eal: stop using variadic argument pack extension
  vhost: stop using variadic argument pack extension
  vhost: stop using variadic argument pack extension
  ip_frag: stop using variadic argument pack extension

 lib/bpf/bpf_impl.h                         |  4 ++--
 lib/cfgfile/rte_cfgfile.c                  |  5 +++--
 lib/cmdline/cmdline_parse.c                |  2 +-
 lib/cmdline/cmdline_parse_num.c            |  4 ++--
 lib/compressdev/rte_compressdev_internal.h |  4 ++--
 lib/eal/common/eal_trace.h                 |  8 ++++----
 lib/ip_frag/ip_frag_common.h               |  4 ++--
 lib/log/rte_log.h                          | 14 ++++++++++++++
 lib/metrics/rte_metrics_telemetry.c        | 12 ++++++------
 lib/mldev/rte_mldev.h                      |  4 ++--
 lib/net/rte_net_crc.c                      |  4 ++--
 lib/pdump/rte_pdump.c                      |  4 ++--
 lib/power/power_common.h                   |  6 +++---
 lib/rawdev/rte_rawdev_pmd.h                | 17 +++++++++--------
 lib/rcu/rte_rcu_qsbr.c                     |  4 ++--
 lib/rcu/rte_rcu_qsbr.h                     | 12 ++++++------
 lib/stack/stack_pvt.h                      | 16 ++++++++--------
 lib/vhost/vhost.h                          |  8 ++++----
 lib/vhost/vhost_crypto.c                   | 21 +++++++++++----------
 19 files changed, 85 insertions(+), 68 deletions(-)
  

Comments

Morten Brørup Feb. 23, 2024, 8:10 a.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Friday, 23 February 2024 00.46
> 
> RTE_LOG_LINE cannot be augmented with a prefix format and arguments
> without the user of RTE_LOG_LINE using the args... and ## args compiler
> extension to conditionally remove trailing comma when the macro receives
> only a single argument.
> 
> Provide a new/similar macro RTE_LOG_LINE_PREFIX that accepts the prefix
> format and arguments as separate parameters allowing them to be expanded
> at the correct locations inside of RTE_FMT() allowing the rest of the
> non-prefix format string and arguments to be collapsed to the argument
> pack which can be directly forwarded with __VA_ARGS__ avoiding the need
> for conditional comma removal.
> 
> I've done my best to manually check expansions (preprocessed) and
> compiled printf of the logs to validate correct output.
> 
> note: due to drastic change in series i have not carried any series acks
>       forward.

Series-acked-by: Morten Brørup <mb@smartsharesystems.com>