]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, vtysh: rebase hashstats 742/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 30 Jun 2017 16:56:10 +0000 (16:56 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 1 Jul 2017 23:18:39 +0000 (19:18 -0400)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/hash.c
vtysh/vtysh.c

index 57cc87be12439d7483c8237f821a7457c4eed98b..95643bbae0a5dffc9916196d94e25c7e65c72d41 100644 (file)
@@ -458,22 +458,21 @@ DEFUN(show_hash_stats,
   char underln[sizeof(header) + strlen(frr_protonameinst)];
   memset (underln, '-', sizeof(underln));
   underln[sizeof(underln) - 1] = '\0';
-  vty_out (vty, "%s%s%s", header, frr_protonameinst, VTY_NEWLINE);
-  vty_out (vty, "%s%s", underln, VTY_NEWLINE);
+  vty_outln (vty, "%s%s", header, frr_protonameinst);
+  vty_outln (vty, "%s", underln);
 
-  vty_out (vty, "# allocated: %d%s", _hashes->count, VTY_NEWLINE);
-  vty_out (vty, "# named:     %d%s%s", tt->nrows - 1, VTY_NEWLINE,
-           VTY_NEWLINE);
+  vty_outln (vty, "# allocated: %d", _hashes->count);
+  vty_outln (vty, "# named:     %d%s", tt->nrows - 1, VTYNL);
 
   if (tt->nrows > 1)
     {
       ttable_colseps (tt, 0, RIGHT, true, '|');
-      char *table = ttable_dump (tt, VTY_NEWLINE);
-      vty_out (vty, "%s%s", table, VTY_NEWLINE);
+      char *table = ttable_dump (tt, VTYNL);
+      vty_out (vty, "%s%s", table, VTYNL);
       XFREE (MTYPE_TMP, table);
     }
   else
-    vty_out (vty, "No named hash tables to display.%s", VTY_NEWLINE);
+    vty_outln (vty, "No named hash tables to display.");
 
   ttable_del (tt);
 
index d95a2d2863b576e22795b8876ce5075cc55601fd..0e04f4bf8e5103fc2ed711e3aea0bb34be03f5fd 100644 (file)
@@ -2114,15 +2114,13 @@ DEFUN (vtysh_show_hashtable,
   unsigned long i;
   int ret = CMD_SUCCESS;
 
-  vty_out (vty, "%sLoad factor (LF) - average number of elements across all "
-                "buckets%s", VTY_NEWLINE, VTY_NEWLINE);
-  vty_out (vty, "Full load factor (FLF) - average number of elements "
-                "across full buckets%s%s", VTY_NEWLINE, VTY_NEWLINE);
-
-  vty_out (vty, "Standard deviation (SD) is calculated for both the LF and FLF%s", VTY_NEWLINE);
-  vty_out (vty, "and indicates the typical deviation of bucket chain length%s", VTY_NEWLINE);
-  vty_out (vty, "from the value in the corresponding load factor.%s%s",
-           VTY_NEWLINE, VTY_NEWLINE);
+  fprintf (stdout, "\n");
+  fprintf (stdout, "Load factor (LF) - average number of elements across all buckets\n");
+  fprintf (stdout, "Full load factor (FLF) - average number of elements across full buckets\n\n");
+
+  fprintf (stdout, "Standard deviation (SD) is calculated for both the LF and FLF\n");
+  fprintf (stdout, "and indicates the typical deviation of bucket chain length\n");
+  fprintf (stdout, "from the value in the corresponding load factor.\n\n");
 
   for (i = 0; i < array_size(vtysh_client); i++)
     if ( vtysh_client[i].fd >= 0 ) {