diff options
author | Jarek Poplawski <jarkao2@o2.pl> | 2007-01-31 15:21:24 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:38:40 -0500 |
commit | 2cf6c36cb46d69057db2ebae0d8ec352e065f48b (patch) | |
tree | 05e735e5d2bd0e2d95e091cd3328a632f48450cb /net/sched/sch_prio.c | |
parent | 5986a2ec35836a878350c54af4bd91b1de6abc59 (diff) |
[NET_SCHED] sch_prio: class statistics printing enabled
This patch adds a dump_stats callback to enable
printing of basic statistics of prio classes.
(With help of Patrick McHardy).
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r-- | net/sched/sch_prio.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 2567b4c96c1e..000e043ebd62 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -372,6 +372,20 @@ static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff * | |||
372 | return 0; | 372 | return 0; |
373 | } | 373 | } |
374 | 374 | ||
375 | static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl, | ||
376 | struct gnet_dump *d) | ||
377 | { | ||
378 | struct prio_sched_data *q = qdisc_priv(sch); | ||
379 | struct Qdisc *cl_q; | ||
380 | |||
381 | cl_q = q->queues[cl - 1]; | ||
382 | if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 || | ||
383 | gnet_stats_copy_queue(d, &cl_q->qstats) < 0) | ||
384 | return -1; | ||
385 | |||
386 | return 0; | ||
387 | } | ||
388 | |||
375 | static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg) | 389 | static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg) |
376 | { | 390 | { |
377 | struct prio_sched_data *q = qdisc_priv(sch); | 391 | struct prio_sched_data *q = qdisc_priv(sch); |
@@ -414,6 +428,7 @@ static struct Qdisc_class_ops prio_class_ops = { | |||
414 | .bind_tcf = prio_bind, | 428 | .bind_tcf = prio_bind, |
415 | .unbind_tcf = prio_put, | 429 | .unbind_tcf = prio_put, |
416 | .dump = prio_dump_class, | 430 | .dump = prio_dump_class, |
431 | .dump_stats = prio_dump_class_stats, | ||
417 | }; | 432 | }; |
418 | 433 | ||
419 | static struct Qdisc_ops prio_qdisc_ops = { | 434 | static struct Qdisc_ops prio_qdisc_ops = { |