linux/net/sctp
Daniel Borkmann bb33381d0c net: sctp: rework debugging framework to use pr_debug and friends
We should get rid of all own SCTP debug printk macros and use the ones
that the kernel offers anyway instead. This makes the code more readable
and conform to the kernel code, and offers all the features of dynamic
debbuging that pr_debug() et al has, such as only turning on/off portions
of debug messages at runtime through debugfs. The runtime cost of having
CONFIG_DYNAMIC_DEBUG enabled, but none of the debug statements printing,
is negligible [1]. If kernel debugging is completly turned off, then these
statements will also compile into "empty" functions.

While we're at it, we also need to change the Kconfig option as it /now/
only refers to the ifdef'ed code portions in outqueue.c that enable further
debugging/tracing of SCTP transaction fields. Also, since SCTP_ASSERT code
was enabled with this Kconfig option and has now been removed, we
transform those code parts into WARNs resp. where appropriate BUG_ONs so
that those bugs can be more easily detected as probably not many people
have SCTP debugging permanently turned on.

To turn on all SCTP debugging, the following steps are needed:

 # mount -t debugfs none /sys/kernel/debug
 # echo -n 'module sctp +p' > /sys/kernel/debug/dynamic_debug/control

This can be done more fine-grained on a per file, per line basis and others
as described in [2].

 [1] https://www.kernel.org/doc/ols/2009/ols2009-pages-39-46.pdf
 [2] Documentation/dynamic-debug-howto.txt

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-01 23:22:13 -07:00
..
associola.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
auth.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-02-08 18:02:14 -05:00
bind_addr.c net: sctp: get rid of t_new macro for kzalloc 2013-06-17 17:08:04 -07:00
chunk.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
command.c
debug.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
endpointola.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
input.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
inqueue.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
ipv6.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
Kconfig net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
Makefile
objcnt.c sctp: Make the proc files per network namespace. 2012-08-14 23:29:53 -07:00
output.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
outqueue.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
primitive.c sctp: Push struct net down to sctp_chunk_event_lookup 2012-08-14 23:30:37 -07:00
probe.c net: sctp: attribute printl with __printf for gcc fmt checks 2013-05-01 15:04:10 -04:00
proc.c net: sctp: minor: sctp_seq_dump_local_addrs add missing newline 2013-06-25 16:33:04 -07:00
protocol.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_make_chunk.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_sideeffect.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_statefuns.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
sm_statetable.c sctp: Make sysctl tunables per net 2012-08-14 23:32:16 -07:00
socket.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
ssnmap.c net: sctp: sctp_ssnmap: remove 'malloced' element from struct 2013-04-17 14:13:02 -04:00
sysctl.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
transport.c net: sctp: rework debugging framework to use pr_debug and friends 2013-07-01 23:22:13 -07:00
tsnmap.c net: sctp: remove SCTP_STATIC macro 2013-06-17 17:08:05 -07:00
ulpevent.c net: sctp: remove SCTP_STATIC macro 2013-06-17 17:08:05 -07:00
ulpqueue.c net: sctp: sctp_ulpq: remove 'malloced' struct member 2013-04-17 14:13:02 -04:00