mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
fixup! various fices
This commit is contained in:
parent
1fb14f5769
commit
6ab2f0fa54
10
nest/cmds.c
10
nest/cmds.c
@ -159,9 +159,12 @@ cmd_show_memory(void)
|
||||
|
||||
|
||||
struct cbor_writer *w = cbor_init(lp_new(proto_pool), 1000);
|
||||
cbor_open_block_with_length(w, 1);
|
||||
|
||||
cbor_add_string(w, "show_memory:message");
|
||||
cbor_open_block_with_length(w, 2);
|
||||
|
||||
cbor_string_string(w, "BIRD memory usage", "header");
|
||||
cbor_string_string(w, "header", "BIRD memory usage");
|
||||
|
||||
cbor_add_string(w, "body");
|
||||
cbor_open_block(w);
|
||||
@ -180,15 +183,14 @@ cmd_show_memory(void)
|
||||
|
||||
memory = rmemsize(&root_pool);
|
||||
#ifdef HAVE_MMAP
|
||||
cbor_named_block_two_ints(w, "standby", "effective", 0, "overhead", page_size * *pages_kept);
|
||||
cbor_named_block_two_ints(w, "standby_memory", "effective", 0, "overhead", page_size * *pages_kept);
|
||||
#endif
|
||||
memory.overhead += page_size * *pages_kept;
|
||||
cbor_named_block_two_ints(w, "total", "effective", memory.effective, "overhead", memory.overhead);
|
||||
|
||||
cbor_close_block_or_list(w); // we do not know for sure, that standby memory will be printed, so we do not know number of block items. If we know that, we open the block for 6 (or 5) items and we do not close anything
|
||||
|
||||
|
||||
cbor_write_to_file(w, "/home/kkubecova/Dokumenty/bird/yang/show_memory_generated.yang");
|
||||
cbor_write_to_file(w, "/home/kkubecova/Dokumenty/bird/yang/show_memory_generated.cbor");
|
||||
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -3,28 +3,28 @@
|
||||
"header": "BIRD memory usage",
|
||||
"body": {
|
||||
"routing_tables": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 34604,
|
||||
"overhead": 2848
|
||||
},
|
||||
"route_attributes": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 26826,
|
||||
"overhead": 13448
|
||||
},
|
||||
"protocols": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 70412,
|
||||
"overhead": 18256
|
||||
},
|
||||
"current_config": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 299744,
|
||||
"overhead": 2152
|
||||
},
|
||||
"standby_memory": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 0,
|
||||
"overhead": 348160
|
||||
},
|
||||
"total": {
|
||||
"effective": 324,
|
||||
"overhead": 48
|
||||
"effective": 513602,
|
||||
"overhead": 391904
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user