Re: [LARTC] HTB_debug_dump: is annoying :) [Pach included]

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



And what about attached one ? It seems to do the same
but is less intrusive. htb_debug_dump is meant to do
its output in all cases because it is called from
bug-reporting places too.
But yes the call in htb_dump is superfluous so I used
your idea but changed it a bit. I'll submit it for
inclusion latter.

thanks,
-------------------------------
    Martin Devera aka devik
Linux kernel QoS/HTB maintainer
  http://luxik.cdi.cz/~devik/

> On Sat, 2003-07-05 at 03:09, Mike Mestnik wrote:
> > I use MRTG to graph tc -d output, so the debug_dump fills up my dmesg logs ect.  It's just
> > annoying.
> >
> > Attached is a patch vs 2.5.74 and my MRTG script.
> >
> > __________________________________
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> --
> ( >-        LINUX, It's all about CHOICE      -< )
> /~\    __        twarren@xxxxxxxxxx       __   /~\
> |  \) /  Pre Sales Consultant - Red Hat     \ (/ |
> |_|_  \    9820349221(M) | 22881326(O)      / _|_|
>        \___________________________________/
>
> _______________________________________________
> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
>
--- sch_htb.c	2003/06/18 19:55:49	1.20
+++ sch_htb.c	2003/07/05 10:37:51
@@ -21,7 +21,7 @@
  *			created test case so that I was able to fix nasty bug
  *		and many others. thanks.
  *
- * $Id: sch_htb.c,v 1.20 2003/06/18 19:55:49 devik Exp $
+ * $Id: sch_htb.c,v 1.21 2003/07/05 10:37:11 devik Exp devik $
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -98,7 +98,8 @@
  from LSB
  */
 #ifdef HTB_DEBUG
-#define HTB_DBG(S,L,FMT,ARG...) if (((q->debug>>(2*S))&3) >= L) \
+#define HTB_DBG_COND(S,L) (((q->debug>>(2*S))&3) >= L)
+#define HTB_DBG(S,L,FMT,ARG...) if (HTB_DBG_COND(S,L)) \
 	printk(KERN_DEBUG FMT,##ARG)
 #define HTB_CHCL(cl) BUG_TRAP((cl)->magic == HTB_CMAGIC)
 #define HTB_PASSQ q,
@@ -114,6 +115,7 @@
 		rb_erase(N,R); \
 		(N)->rb_color = -1; } while (0)
 #else
+#define HTB_DBG_COND(S,L) (0)
 #define HTB_DBG(S,L,FMT,ARG...)
 #define HTB_PASSQ
 #define HTB_ARGQ
@@ -1202,7 +1204,8 @@ static int htb_dump(struct Qdisc *sch, s
 	gopt.direct_pkts = q->direct_pkts;
 
 #ifdef HTB_DEBUG
-	htb_debug_dump(q);
+	if (HTB_DBG_COND(0,2))
+		htb_debug_dump(q);
 #endif
 	gopt.version = HTB_VER;
 	gopt.rate2quantum = q->rate2quantum;

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux