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

2003-07-05 Thread devik
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  -< )
> /~\__[EMAIL PROTECTED]   __   /~\
> |  \) /  Pre Sales Consultant - Red Hat \ (/ |
> |_|_  \9820349221(M) | 22881326(O)  / _|_|
>\___/
>
> ___
> LARTC mailing list / [EMAIL PROTECTED]
> 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 
 #include 
@@ -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;


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

2003-07-05 Thread Mike Mestnik
No, the patch dose not affect tc only dmesg/klogd ect.  It changes printk's into 
HTB_DBG macros,
these macros don't print unless you set HTB into debug mode :)

The default kernel workes ?great? with my script 2.4.x and 2.5.x.

Here is an example...
The script workes like so... (10: is the qdisc-id)
filbert:~# /etc/network/mrtg.overlimits.pl 10: total,over
96320 <-- This is the total.
6630  <-- These are the overlimits (the total,over param dose this)
filbert:~# /etc/network/mrtg.overlimits.pl 10: total,over
96336
6654
filbert:~# /etc/network/mrtg.overlimits.pl 10: total,over
96359
6683
filbert:~# /etc/network/mrtg.overlimits.pl 10: total,over
96373
6705

mrtg.cfg lookes like this.
#
#
#
   
   

Target[toverlimits]: `/etc/network/mrtg.overlimits.pl 10: total,over`
MaxBytes[toverlimits]: 6400
AbsMax[toverlimits]: 64
WithPeak[toverlimits]: wmy
Options[toverlimits]: noinfo, perminute
YLegend[toverlimits]: Packets/Minute
ShortLegend[toverlimits]: p/min
Legend1[toverlimits]: Sent Traffic in Packets per Minute
Legend2[toverlimits]: Overlimit Traffic in Packets per Minute
Legend3[toverlimits]: Maximal 5 Minute Sent Traffic
Legend4[toverlimits]: Maximal 5 Minute Overlimit Traffic
LegendI[toverlimits]:  Sent:
LegendO[toverlimits]:  Overlimit:
Title[toverlimits]: Root Qdisc Sent/Overlimits on Internet Pipe -- Filbert
PageTop[toverlimits]: Root Qdisc Sent/Overlimits on Internet Pipe -- Filbert
 
   System: Filbert (Main Router and Moms PC)
   Maintainer: Cheako [EMAIL PROTECTED]
   Description:Sent/Overlimits on Internet Pipe
 
   
   

#---

You can see my graphs at http://filbert.is-a-geek.org/mrtg/

P.N. The original patch I sent in had one bug, theres a part that lookes like this 
"q->debug>>(0)
|= 3;"
It needed to look like this. "debug_backup = q->debug;"

@@ -1046,7 +1047,10 @@
if (min_delay == LONG_MAX) {
printk(KERN_ERR "HTB: dequeue bug (%d,%lu,%lu), report it 
please !\n",
evs_used,q->jiffies,jiffies);
+   debug_backup = q->debug;
+   q->debug |= 3>>(0);
htb_debug_dump(q);
+   q->debug = debug_backup;
} else
printk(KERN_WARNING "HTB: mindelay=%ld, some class has "
"too small rate\n",min_delay);


--- Trevor Warren <[EMAIL PROTECTED]> wrote:
> Sorry Mike,
> 
>  This isn't an answer to your queries but instead a question. I would
> like to know if there are any added fields to the tc -s -d output post
> application of the 2.5 kernel patch you have applied below.
> 
>  Cause i am using htb with 2.4.21 and there isn't much of graphing i can
> do with the same. Especially no current rate parameter for HTB sub
> classes.
> 
> Trevor
> 
> 
> 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  -< )
> /~\__[EMAIL PROTECTED]   __   /~\
> |  \) /  Pre Sales Consultant - Red Hat \ (/ |
> |_|_  \9820349221(M) | 22881326(O)  / _|_|
>\___/
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


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

2003-07-04 Thread Trevor Warren
Sorry Mike,

 This isn't an answer to your queries but instead a question. I would
like to know if there are any added fields to the tc -s -d output post
application of the 2.5 kernel patch you have applied below.

 Cause i am using htb with 2.4.21 and there isn't much of graphing i can
do with the same. Especially no current rate parameter for HTB sub
classes.

Trevor


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  -< )
/~\__[EMAIL PROTECTED]   __   /~\
|  \) /  Pre Sales Consultant - Red Hat \ (/ |
|_|_  \9820349221(M) | 22881326(O)  / _|_|
   \___/

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


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

2003-07-04 Thread Mike Mestnik
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-2.5.74.htbdebug.patch
Description: linux-2.5.74.htbdebug.patch


mrtg.overlimits.pl
Description: mrtg.overlimits.pl