batctl: Add tp debug log messages switch
PATCH 1/1 batctl: Add tp debug log messages switch
The switch to enable/disable throughput meter debug messages in batctl log is supported since batman-adv 2016.3 but was never adopted in batctl.
Signed-off-by Sven Eckelmann <[email protected]>
--- README.rst | 1 + man/batctl.8 | 7 ++++--- sys.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-)
README.rst +1 -0
@@ -428,6 +428,7 @@ Example:: [ ] messages related to arp snooping and distributed arp table (dat) [ ] messages related to network coding (nc) [ ] messages related to multicast (mcast) + [ ] messages related to throughput meter (tp) batctl nc_nodes
man/batctl.8 +4 -3
@@ -107,9 +107,10 @@ level. Level 'none' disables all verbose logging. Level 'batman' enables message Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'dat' enables messages related to ARP snooping and the Distributed Arp Table. Level 'nc' enables messages related to network coding. -Level 'mcast' enables messages related to multicast optimizations. Level 'all' enables all messages. The messages -are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging output enabled -when compiling the module otherwise the output as well as the loglevel options won't be available. +Level 'mcast' enables messages related to multicast optimizations. Level 'tp' enables messages related to throughput meter. +Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. +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
sys.c +6 -1
@@ -132,6 +132,7 @@ static void log_level_usage(void)fprintf (stderr," \t dat Messages related to arp snooping and distributed arp table\n" );fprintf (stderr," \t nc Messages related to network coding\n" );fprintf (stderr," \t mcast Messages related to multicast\n" ); +fprintf (stderr," \t tp Messages related to throughput meter\n" ); }int handle_loglevel (char *mesh_iface,int argc,char **argv)
@@ -169,7 +170,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) log_level =0 ;break ; }else if (strcmp (argv[i],"all" ) ==0 ) { - log_level =127 ; + log_level =255 ;break ; }else if (strcmp (argv[i],"batman" ) ==0 ) log_level |=BIT (0 );
@@ -185,6 +186,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) log_level |=BIT (5 ); else if (strcmp(argv[i], "mcast") == 0) log_level |= BIT(6); + else if (strcmp(argv[i], "tp") == 0) + log_level |= BIT(7); else {log_level_usage (); goto out;
@@ -220,6 +223,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) "messages related to network coding", "nc");printf ("[%c] %s (%s)\n" , (log_level &BIT (6 )) ?'x' :' ' ,"messages related to multicast" ,"mcast" ); +printf ("[%c] %s (%s)\n" , (log_level &BIT (7 )) ?'x' :' ' , +"messages related to throughput meter" ,"tp" ); out:free (path_buff);
Signature · 1 line
2.16.2