batctl: Drop log subcommand
PATCH 1/1 batctl: Drop log subcommand
The correct way to get a log of the activities of batman-adv is to use the standard kernel tracing infrastructure:
$ trace-cmd stream -e batadv:batadv_dbg
The batman-adv specific log file will be removed in the future when the debugfs is dropped. And even for kernels without tracing support, most of the functionality (except mac address to bat_hosts translation) can be replaced by a simple:
$ cat /sys/kernel/debug/batman_adv/bat0/log
--- Makefile | 1 - README.rst | 22 -------------------- debug.h | 1 - functions.c | 7 ++----- functions.h | 1 - log.c | 59 ---------------------------------------------------- man/batctl.8 | 4 ---- 7 files changed, 2 insertions(+), 93 deletions(-) delete mode 100644 log.c
Makefile +0 -1
@@ -52,7 +52,6 @@ $(eval $(call add_command,gw_mode,y)) $(eval $(call add_command,hop_penalty,y)) $(eval $(call add_command,interface,y)) $(eval $(call add_command,isolation_mark,y)) -$(eval $(call add_command,log,y)) $(eval $(call add_command,loglevel,y)) $(eval $(call add_command,mcast_flags,y)) $(eval $(call add_command,multicast_fanout,y))
README.rst +0 -22
@@ -386,28 +386,6 @@ Example:: 1000 -batctl log -========== - -read the log produced by the kernel module - -Usage:: - - batctl log|l - -Example:: - - $ batctl log - [ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:01:01 via prev OG: fe:fe:00:00:01:01 seqno 670, tq 245, TTL 49, V 8, IDF 1) - [ 400] Drop packet: originator packet from myself (via neighbour) - [ 400] Received BATMAN packet via NB: fe:fe:00:00:02:01 IF: eth0 [fe:fe:00:00:01:01] (from OG: fe:fe:00:00:02:01 via prev OG: fe:fe:00:00:02:01 seqno 545, tq 255, TTL 50, V 8, IDF 0) - [ 400] updating last_seqno: old 544, new 545 - [ 400] bidirectional: orig = fe:fe:00:00:02:01 neigh = fe:fe:00:00:02:01 => own_bcast = 64, real recv = 64, local tq: 255, asym_penalty: 255, total tq: 255 - [ 400] update_originator(): Searching and updating originator entry of received packet - [ 400] Updating existing last-hop neighbour of originator - [...] - - batctl loglevel ===============
debug.h +0 -1
@@ -19,7 +19,6 @@#define DEBUG_DAT_CACHE "dat_cache"#define DEBUG_NC_NODES "nc_nodes"#define DEBUG_MCAST_FLAGS "mcast_flags" -#define DEBUG_LOG "log"#define DEBUG_ROUTING_ALGOS "routing_algos"struct debug_table_data {
functions.c +2 -5
@@ -275,11 +275,8 @@ int read_file(const char *dir, const char *fname, int read_opt,if (!bat_host) goto print_plain_buff; -if (read_opt &LOG_MODE ) -printf ("%s" , bat_host->name); -else -/* keep table format */ -printf ("%17s" , bat_host->name); +/* keep table format */ +printf ("%17s" , bat_host->name); goto written;
functions.h +0 -1
@@ -69,7 +69,6 @@ enum {CONT_READ =0x01 ,CLR_CONT_READ =0x02 ,USE_BAT_HOSTS =0x04 , -LOG_MODE =0x08 ,USE_READ_BUFF =0x10 ,SILENCE_ERRORS =0x20 , NO_OLD_ORIGS = 0x40,
log.c deleted +0 -59
59 lines not on this page · raw message
man/batctl.8 +0 -4
@@ -127,10 +127,6 @@ Level 'all' enables all messages. The messages are sent to the batman-adv debug Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options won't be available. .br -.IP "\fBlog\fP|\fBl\fP [\fB\-n\fP]\fP" -batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "\-n" is given batctl will not -replace the MAC addresses with bat\-host names in the output. -.br .IP "\fBgw_mode|gw\fP [\fBoff\fP|\fBclient\fP|\fBserver\fP] [\fBsel_class|bandwidth\fP]\fP" If no parameter is given the current gateway mode is displayed otherwise the parameter is used to set the gateway mode. The second (optional) argument specifies the selection class (if 'client' was the first argument) or the gateway bandwidth (if 'server'
Signature · 1 line
2.20.1
Quoted 10 lines · Sven Eckelmann
The correct way to get a log of the activities of batman-adv is to use the standard kernel tracing infrastructure:
$ trace-cmd stream -e batadv:batadv_dbgThe batman-adv specific log file will be removed in the future when the debugfs is dropped. And even for kernels without tracing support, most of the functionality (except mac address to
bat_hoststranslation) can be replaced by a simple:
Quoted 4 lines
$ cat /sys/kernel/debug/batman_adv/bat0/logSigned-off-by Sven Eckelmann <[email protected]>---
The trace-cmd approach does not add/provide network namespace support, does it?
If we were removing "batctl log" now we would probably need to readd it later again when adding network namespace support, both for either a netlink or IPv6 node-local multicast approach, right [0]?
(Although for the IPv6 node-local multicast 'socat' for instance would work, too.)
[0]: 'Make "batctl log" usable with network namespaces'
https://www.open-mesh.org/issues/339
Quoted 5 lines · On Monday, 22 April 2019 11:20:48 CEST Linus Lüssing wrote:
Quoted 4 lines · Sven Eckelmann
The correct way to get a log of the activities of batman-adv is to use the standard kernel tracing infrastructure:
$ trace-cmd stream -e batadv:batadv_dbg
[...]
Quoted 2 lines
The trace-cmd approach does not add/provide network namespace support, does it?
Afaik, not at the moment.
Quoted 6 lines
If we were removing "batctl log" now we would probably need to readd it later again when adding network namespace support, both for either a netlink or IPv6 node-local multicast approach, right [0]?
(Although for the IPv6 node-local multicast 'socat' for instance would work, too.)
I am rather sure that we shouldn't add the namespace specific logs in batman- adv via a batadv specific new infrastructure. Sounds like horrible hacks which we shouldn't even try to upstream.
Kind regards,
Sven