All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Mestnik <cheako911@yahoo.com>
To: lartc@vger.kernel.org
Subject: [LARTC] HTB_debug_dump: is annoying :) [Pach included]
Date: Fri, 04 Jul 2003 21:39:27 +0000	[thread overview]
Message-ID: <marc-lartc-105735485116272@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105737651226550@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

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

[-- Attachment #2: linux-2.5.74.htbdebug.patch --]
[-- Type: application/octet-stream, Size: 2646 bytes --]

--- sch_htb.c	Wed Jul  2 15:50:07 2003
+++ sch_htb.c.myne	Fri Jul  4 16:08:57 2003
@@ -335,22 +335,22 @@
 	while (n->rb_left) n = n->rb_left; \
 	while (n) { \
 		struct htb_class *cl = rb_entry(n, struct htb_class, memb); \
-		printk(" %x",cl->classid); htb_next_rb_node (&n); \
+		HTB_DBG(0,3," %x",cl->classid); htb_next_rb_node (&n); \
 	} }
 
 static void htb_debug_dump (struct htb_sched *q)
 {
 	int i,p;
-	printk(KERN_DEBUG "htb*g j=%lu lj=%lu\n",jiffies,q->jiffies);
+	HTB_DBG(0,1,"htb*g j=%lu lj=%lu\n",jiffies,q->jiffies);
 	/* rows */
 	for (i=TC_HTB_MAXDEPTH-1;i>=0;i--) {
-		printk(KERN_DEBUG "htb*r%d m=%x",i,q->row_mask[i]);
+		HTB_DBG(0,2,"htb*r%d m=%x",i,q->row_mask[i]);
 		for (p=0;p<TC_HTB_NUMPRIO;p++) {
 			if (!q->row[i][p].rb_node) continue;
-			printk(" p%d:",p);
+			HTB_DBG(0,3," p%d:",p);
 			HTB_DUMTREE(q->row[i]+p,node[p]);
 		}
-		printk("\n");
+		HTB_DBG(0,2,"\n");
 	}
 	/* classes */
 	for (i = 0; i < HTB_HSIZE; i++) {
@@ -358,7 +358,7 @@
 		list_for_each (l,q->hash+i) {
 			struct htb_class *cl = list_entry(l,struct htb_class,hlist);
 			long diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
-			printk(KERN_DEBUG "htb*c%x m=%d t=%ld c=%ld pq=%lu df=%ld ql=%d "
+			HTB_DBG(0,2,"htb*c%x m=%d t=%ld c=%ld pq=%lu df=%ld ql=%d "
 					"pa=%x f:",
 				cl->classid,cl->cmode,cl->tokens,cl->ctokens,
 				cl->pq_node.rb_color==-1?0:cl->pq_key,diff,
@@ -366,10 +366,10 @@
 			if (cl->level)
 			for (p=0;p<TC_HTB_NUMPRIO;p++) {
 				if (!cl->un.inner.feed[p].rb_node) continue;
-				printk(" p%d a=%x:",p,cl->un.inner.ptr[p]?rb_entry(cl->un.inner.ptr[p], struct htb_class,node[p])->classid:0);
+				HTB_DBG(0,3," p%d a=%x:",p,cl->un.inner.ptr[p]?rb_entry(cl->un.inner.ptr[p], struct htb_class,node[p])->classid:0);
 				HTB_DUMTREE(cl->un.inner.feed+p,node[p]);
 			}
-			printk("\n");
+			HTB_DBG(0,2,"\n");
 		}
 	}
 }
@@ -994,6 +994,7 @@
 	struct htb_sched *q = (struct htb_sched *)sch->data;
 	int level;
 	long min_delay;
+	u32 debug_backup;
 #ifdef HTB_DEBUG
 	int evs_used = 0;
 #endif
@@ -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>>(0) |= 3;
 			htb_debug_dump(q);
+			q->debug = debug_backup;
 		} else 
 			printk(KERN_WARNING "HTB: mindelay=%ld, some class has "
 					"too small rate\n",min_delay);
@@ -1188,7 +1192,7 @@
 	gopt.direct_pkts = q->direct_pkts;
 
 #ifdef HTB_DEBUG
-	htb_debug_dump(q);
+	if (((q->debug>>(0))&3) >= 1) htb_debug_dump(q);
 #endif
 	gopt.version = HTB_VER;
 	gopt.rate2quantum = q->rate2quantum;

[-- Attachment #3: mrtg.overlimits.pl --]
[-- Type: application/x-perl, Size: 683 bytes --]

  reply	other threads:[~2003-07-04 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04 15:37 [LARTC] HTB_debug_dump: is annoying :) [Pach included] Trevor Warren
2003-07-04 21:39 ` Mike Mestnik [this message]
2003-07-05  8:34 ` Mike Mestnik
2003-07-05 10:49 ` devik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-105735485116272@msgid-missing \
    --to=cheako911@yahoo.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.