Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_cbq.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_cbq.c	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_cbq.c	(working copy)
@@ -589,6 +589,7 @@
             return NULL;
         }
 
+
 	m = rmc_dequeue_next(&cbqp->ifnp, op);
             
 
@@ -605,6 +606,7 @@
             fastlog_syslog(LOG_DEBUG, "cbq_dequeue : %x - no packet to dequue, no of outstanding packets to be dequeued : %d\n", cbqp, cbqp->cbq_qlen);
         }
 #endif
+	total_outstanding_mbuf = cbqp->cbq_qlen;
 	return (m);
 }
 
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_rmclass.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_rmclass.c	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/altq_rmclass.c	(working copy)
@@ -80,6 +80,8 @@
 
 #include <sys/syslog.h>
 #include <click/app/qos/qos_dynamic.h>
+#include <click/netinet/click_var.h>
+#include <click/app/qos/qos_classifier.h>
 /*
  * Local Macros
  */
@@ -95,6 +97,7 @@
 extern int loop_class_count;
 extern int q_len_wait;
 
+extern qos_filter_share_t qos_filter_share;
 
 static int	rmc_satisfied(struct rm_class *, struct timeval *);
 static void	rmc_wrr_set_weights(struct rm_ifdat *);
@@ -970,7 +973,8 @@
 
 	if (_rmc_addq(cl, m) < 0) {
 		/* failed */
-                fastlog_syslog(LOG_DEBUG, "rmc_queue_packet : FAILED to enqueue mbuf for the class : %x\n", cl);
+		qos_filter_share.fltr_g_stats.q_enqueue_fail[cpri]++;
+		fastlog_syslog(LOG_DEBUG, "rmc_queue_packet : FAILED to enqueue mbuf for the class : %x\n", cl);
 		return (-1);
         }
 
@@ -982,6 +986,7 @@
 	if (qlen(cl->q_) > qlimit(cl->q_)) {
 		/* note: qlimit can be set to 0 or 1 */
                 fastlog_syslog(LOG_DEBUG, "mbuf DROP action for class : %x. Pending mbuf's : %d. Max allowed mbuf's : %d\n", cl, qlen(cl->q_), qlimit(cl->q_));
+		qos_filter_share.fltr_g_stats.q_full_count[cpri]++;
 		rmc_drop_action(cl);
 		return (-1);
 	}
@@ -1216,6 +1221,8 @@
 				cl->bytes_alloc_ += cl->w_allotment_;
 			}
 			if (!qempty(cl->q_)) {
+				qos_filter_share.fltr_g_stats.cur_pend_mbuf[cpri] = qlen(cl->q_);
+				qos_filter_share.fltr_g_stats.total_outstanding_mbuf = total_outstanding_mbuf;
 				if ((cl->undertime_.tv_sec == 0) ||
 				    rmc_under_limit(cl, &now)) {
 					if (cl->bytes_alloc_ > 0 || deficit > 1) {
@@ -1227,6 +1234,7 @@
 					first = cl; /* borrowing candidate */
                                 } else if ( qlen(cl->q_) >= q_len_wait) {
                                         fastlog_syslog(LOG_DEBUG, "current pending mbufs for class : %x is %d.....sending out\n", cl, qlen(cl->q_));
+					qos_filter_share.fltr_g_stats.q_overload_count[cpri]++;
 					ifd->borrowed_[ifd->qi_] = NULL;
                                         goto _wrr_out;
                                 } else if (first == NULL && cl->borrow_ != NULL)
@@ -1240,6 +1248,7 @@
 			cl->bytes_alloc_ = 0;
 			cl = cl->peer_;
 		} while (cl != NULL && loop_ct <= loop_class_count); // while (cl != ifd->active_[cpri]);
+                
 
 		if (deficit == 1) {
 			/* first loop found an underlimit class with deficit */
@@ -1304,6 +1313,7 @@
 #ifdef MORELOG
                         fastlog_syslog(LOG_DEBUG, "all packets empty for one of the class : %x. total class's in priority %d is %d\n", cl, cpri, ifd->na_[cpri]);
 #endif
+                        qos_filter_share.fltr_g_stats.total_active_class[cpri] = ifd->na_[cpri];
                 }
                 else if (cl == ifd->active_[cl->pri_]) ;
                 else {
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.h
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.h	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_classifier.h	(working copy)
@@ -183,6 +183,12 @@
 	uint32_t count_add_dyn_table_fail;
 	uint32_t count_del_table_fail;
 	uint32_t count_del_dyn_table_fail;
+	uint32_t q_overload_count[8];
+	uint32_t q_enqueue_fail[8];
+	uint32_t q_full_count[8];
+	uint32_t cur_pend_mbuf[8];
+	uint32_t total_active_class[8];
+	uint32_t total_outstanding_mbuf;
 }qos_filter_tatol_stats_t;
 
 typedef struct __qos_filter_share {
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.h	(working copy)
@@ -31,6 +31,7 @@
 extern struct mtx qos_filter_lock;
 
 extern uint32_t max_dyn_queue;
+extern uint32_t total_outstanding_mbuf;
 
 //CBQ
 extern int class_insert_pos;
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_dynamic.c	(working copy)
@@ -41,6 +41,7 @@
 uint32_t repeat_segment_num = 50;
 uint32_t q_del_step_size = 1;
 uint32_t max_dyn_queue = 800000;
+uint32_t total_outstanding_mbuf = 0;
 
 int class_insert_pos = 8;
 int loop_class_count = 48;
Index: /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c
===================================================================
--- /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c	(revision 38329)
+++ /branches/rel_apv_10_4_0_112_gail/usr/src/sys/click/app/qos/qos_subr.c	(working copy)
@@ -328,11 +328,21 @@
 	app_printf(pcb, "%15u failed operations of adding static filters\n", qs->fltr_g_stats.count_add_table_fail);
 	app_printf(pcb, "%15u failed operations of adding dynamic filters\n", qs->fltr_g_stats.count_add_dyn_table_fail);
 	app_printf(pcb, "%15u failed operations of deleting static filters\n", qs->fltr_g_stats.count_del_table_fail);
-	app_printf(pcb, "%15u failed operations of deleting dynamic filters\n", qs->fltr_g_stats.count_del_dyn_table_fail);
-
+	app_printf(pcb, "%15u failed operations of deleting dynamic filters\n\n", qs->fltr_g_stats.count_del_dyn_table_fail);
+	app_printf(pcb, "QoS statistics for Class Based Queues\n");
+	for (i = 0; i < 8; i++) {
+	    app_printf(pcb, "Statistic for the Priority : %d\n", i);
+	    app_printf(pcb, "%15u queue full\n", qs->fltr_g_stats.q_full_count[i]);
+	    app_printf(pcb, "%15u overload queues\n", qs->fltr_g_stats.q_overload_count[i]);
+	    app_printf(pcb, "%15u enqueue failure\n", qs->fltr_g_stats.q_enqueue_fail[i]);
+	    app_printf(pcb, "%15u current pending mbuf\n", qs->fltr_g_stats.cur_pend_mbuf[i]);
+	    app_printf(pcb, "%15u Total active classes\n\n", qs->fltr_g_stats.total_active_class[i]);
+	}
+	app_printf(pcb, "%15u Total outstanding mbuf\n", qs->fltr_g_stats.total_outstanding_mbuf);
+        
     /* bug 14949, qiuzj, http qos */
-    app_printf(pcb,"\n");
-    show_qos_http_url_statistics(pcb);
+	app_printf(pcb,"\n");
+	show_qos_http_url_statistics(pcb);
 
 	return QOS_SUCCESS;
 }
@@ -747,6 +757,15 @@
 	qs->fltr_g_stats.count_add_dyn_table_fail = 0;
 	qs->fltr_g_stats.count_del_table_fail = 0;
 	qs->fltr_g_stats.count_del_dyn_table_fail = 0;
+        for (i = 0; i < 8; i++) {
+            qs->fltr_g_stats.q_full_count[i] = 0;
+            qs->fltr_g_stats.q_overload_count[i] = 0;
+            qs->fltr_g_stats.q_enqueue_fail[i] = 0;
+            qs->fltr_g_stats.cur_pend_mbuf[i] = 0;
+            qs->fltr_g_stats.total_active_class[i] = 0;
+
+        }
+        qs->fltr_g_stats.total_outstanding_mbuf = 0;
 	
 	/* bug 14949, qiuzj, http qos */
     if (name_for_all == 1) {
