mbox series

[net-next,0/9] l2tp: replace custom logging code with tracepoints

Message ID 20200821104728.23530-1-tparkin@katalix.com
Headers show
Series l2tp: replace custom logging code with tracepoints | expand

Message

Tom Parkin Aug. 21, 2020, 10:47 a.m. UTC
The l2tp subsystem implemented custom logging macros for debugging
purposes which were controlled using a set of debugging flags in each
tunnel and session structure.

A more standard and easier-to-use approach is to use tracepoints.

This patchset refactors l2tp to:

 * remove excessive logging
 * tweak useful log messages to use the standard pr_* calls for logging
   rather than the l2tp wrappers
 * replace debug-level logging with tracepoints
 * add tracepoints for capturing tunnel and session lifetime events

I note that checkpatch.pl warns about the layout of code in the
newly-added file net/l2tp/trace.h.  When adding this file I followed the
example(s) of other tracepoint files in the net/ subtree since it seemed
preferable to adhere to the prevailing style rather than follow
checkpatch.pl's advice in this instance.  If that's the wrong
approach please let me know.

Tom Parkin (9):
  l2tp: don't log data frames
  l2tp: remove noisy logging, use appropriate log levels
  l2tp: use standard API for warning log messages
  l2tp: add tracepoint infrastructure to core
  l2tp: add tracepoint definitions in trace.h
  l2tp: add tracepoints to l2tp_core.c
  l2tp: remove custom logging macros
  l2tp: remove tunnel and session debug flags field
  docs: networking: add tracepoint info to l2tp.rst

 Documentation/networking/l2tp.rst |  37 ++----
 include/uapi/linux/if_pppol2tp.h  |   2 +-
 include/uapi/linux/l2tp.h         |   6 +-
 net/l2tp/Makefile                 |   2 +
 net/l2tp/l2tp_core.c              | 178 +++++++------------------
 net/l2tp/l2tp_core.h              |  23 +---
 net/l2tp/l2tp_debugfs.c           |   4 +-
 net/l2tp/l2tp_eth.c               |  11 --
 net/l2tp/l2tp_ip.c                |  15 ---
 net/l2tp/l2tp_ip6.c               |  15 ---
 net/l2tp/l2tp_netlink.c           |  16 +--
 net/l2tp/l2tp_ppp.c               |  55 ++------
 net/l2tp/trace.h                  | 211 ++++++++++++++++++++++++++++++
 13 files changed, 297 insertions(+), 278 deletions(-)
 create mode 100644 net/l2tp/trace.h

Comments

James Chapman Aug. 21, 2020, 11:25 a.m. UTC | #1
On 21/08/2020 11:47, Tom Parkin wrote:
> The l2tp subsystem implemented custom logging macros for debugging
> purposes which were controlled using a set of debugging flags in each
> tunnel and session structure.
>
> A more standard and easier-to-use approach is to use tracepoints.
>
> This patchset refactors l2tp to:
>
>  * remove excessive logging
>  * tweak useful log messages to use the standard pr_* calls for logging
>    rather than the l2tp wrappers
>  * replace debug-level logging with tracepoints
>  * add tracepoints for capturing tunnel and session lifetime events

Acked-by: James Chapman <jchapman@katalix.com>