mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
2005-10-20 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* memory.c: (show_memory_vty) Omit zero statistics. Print separators only if some non-zero stats have been printed in between. (show_separator) New function to print a separator. (show_memory_all) Keep track of whether a separator is needed between the different memory statistics groups.
This commit is contained in:
parent
38d3c163cf
commit
24065a3d4a
@ -1,3 +1,11 @@
|
|||||||
|
2005-10-20 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
|
* memory.c: (show_memory_vty) Omit zero statistics. Print separators
|
||||||
|
only if some non-zero stats have been printed in between.
|
||||||
|
(show_separator) New function to print a separator.
|
||||||
|
(show_memory_all) Keep track of whether a separator is needed
|
||||||
|
between the different memory statistics groups.
|
||||||
|
|
||||||
2005-10-18 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2005-10-18 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
* memtypes.h: Add MTYPE_OSPF_VERTEX_PARENT (to match memtypes.c).
|
* memtypes.h: Add MTYPE_OSPF_VERTEX_PARENT (to match memtypes.c).
|
||||||
|
34
lib/memory.c
34
lib/memory.c
@ -249,22 +249,33 @@ log_memstats(int pri)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct memory_list memory_list_separator[] =
|
|
||||||
{
|
|
||||||
{ 0, NULL},
|
|
||||||
{-1, NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
show_separator(struct vty *vty)
|
||||||
|
{
|
||||||
|
vty_out (vty, "-----------------------------\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
show_memory_vty (struct vty *vty, struct memory_list *list)
|
show_memory_vty (struct vty *vty, struct memory_list *list)
|
||||||
{
|
{
|
||||||
struct memory_list *m;
|
struct memory_list *m;
|
||||||
|
int needsep = 0;
|
||||||
|
|
||||||
for (m = list; m->index >= 0; m++)
|
for (m = list; m->index >= 0; m++)
|
||||||
if (m->index == 0)
|
if (m->index == 0)
|
||||||
vty_out (vty, "-----------------------------\r\n");
|
{
|
||||||
else
|
if (needsep)
|
||||||
|
{
|
||||||
|
show_separator (vty);
|
||||||
|
needsep = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (mstat[m->index].alloc)
|
||||||
|
{
|
||||||
vty_out (vty, "%-30s: %10ld\r\n", m->format, mstat[m->index].alloc);
|
vty_out (vty, "%-30s: %10ld\r\n", m->format, mstat[m->index].alloc);
|
||||||
|
needsep = 1;
|
||||||
|
}
|
||||||
|
return needsep;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (show_memory_all,
|
DEFUN (show_memory_all,
|
||||||
@ -275,12 +286,13 @@ DEFUN (show_memory_all,
|
|||||||
"All memory statistics\n")
|
"All memory statistics\n")
|
||||||
{
|
{
|
||||||
struct mlist *ml;
|
struct mlist *ml;
|
||||||
|
int needsep = 0;
|
||||||
|
|
||||||
for (ml = mlists; ml->list; ml++)
|
for (ml = mlists; ml->list; ml++)
|
||||||
{
|
{
|
||||||
if (ml != mlists)
|
if (needsep)
|
||||||
show_memory_vty (vty, memory_list_separator);
|
show_separator (vty);
|
||||||
show_memory_vty (vty, ml->list);
|
needsep = show_memory_vty (vty, ml->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user