X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fnode_cli.c;h=bf18702d582cc32052bf1c282f088bb260130f83;hb=62d9fda8e474f87459c6e24d13b09f7bfec146f3;hp=5f0617d7eaeb490fa065a29bb50e6fc387dad5ac;hpb=a8df85ce1fe957efa8301bd5b5ac3c03737d31f1;p=vpp.git diff --git a/src/vlib/node_cli.c b/src/vlib/node_cli.c index 5f0617d7eae..bf18702d582 100644 --- a/src/vlib/node_cli.c +++ b/src/vlib/node_cli.c @@ -335,6 +335,7 @@ show_node_runtime (vlib_main_t * vm, u64 n_internal_vectors, n_internal_calls; u64 n_clocks, l, v, c, d; int brief = 1; + int summary = 0; int max = 0; vlib_main_t **stat_vms = 0, *stat_vm; @@ -345,6 +346,9 @@ show_node_runtime (vlib_main_t * vm, brief = 0; if (unformat (input, "max") || unformat (input, "m")) max = 1; + if (unformat (input, "summary") || unformat (input, "sum") + || unformat (input, "su")) + summary = 1; for (i = 0; i < vec_len (vlib_mains); i++) { @@ -446,19 +450,23 @@ show_node_runtime (vlib_main_t * vm, (f64) n_input / dt, (f64) n_output / dt, (f64) n_drop / dt, (f64) n_punt / dt); - vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm, 0, max); - for (i = 0; i < vec_len (nodes); i++) + if (summary == 0) { - c = - nodes[i]->stats_total.calls - - nodes[i]->stats_last_clear.calls; - d = - nodes[i]->stats_total.suspends - - nodes[i]->stats_last_clear.suspends; - if (c || d || !brief) + vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm, + 0, max); + for (i = 0; i < vec_len (nodes); i++) { - vlib_cli_output (vm, "%U", format_vlib_node_stats, stat_vm, - nodes[i], max); + c = + nodes[i]->stats_total.calls - + nodes[i]->stats_last_clear.calls; + d = + nodes[i]->stats_total.suspends - + nodes[i]->stats_last_clear.suspends; + if (c || d || !brief) + { + vlib_cli_output (vm, "%U", format_vlib_node_stats, + stat_vm, nodes[i], max); + } } } vec_free (nodes); @@ -598,7 +606,7 @@ show_node (vlib_main_t * vm, unformat_input_t * input, if (n->sibling_of) s = format (s, ", sibling-of %s", n->sibling_of); - vlib_cli_output (vm, "node %s, type %s, state %U, index %d%v\n", + vlib_cli_output (vm, "node %v, type %s, state %U, index %d%v\n", n->name, type_str, format_vlib_node_state, vm, n, n->index, s); vec_reset_length (s);