From 6ab2f0fa5426fc785da8808028fad5a160b19d7a Mon Sep 17 00:00:00 2001 From: Katerina Kubecova Date: Thu, 23 Nov 2023 09:51:48 +0100 Subject: [PATCH] fixup! various fices --- nest/cmds.c | 12 +++++++----- yang/show_memory.cbor | Bin 281 -> 296 bytes yang/show_memory.json | 26 +++++++++++++------------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/nest/cmds.c b/nest/cmds.c index 4562262a..941a01a1 100644 --- a/nest/cmds.c +++ b/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_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"); } diff --git a/yang/show_memory.cbor b/yang/show_memory.cbor index f1cfe02cb7d155b76b450b5b67bad10117bd53ed..3c524475c83c1766a2a9f5f5de8fbe87cff8fafa 100644 GIT binary patch literal 296 zcmY+*ohYin`Dw*NOp90qT~cxdjoS3dkl%LW?;gv2weyKMOIZS$;OZ(6%_I{*Lx literal 281 zcmZ|KJr2S!42EHG3)p%DW=7P7l?z1q`O-#8ZE)P89)}K`lSZ&+v-Cce<##C~zs!V* zWxY%&#SYlw2pb^J>+Rlmzt+vQ1jk|hknpUD2BX$xlr14fcufmVhkoP*QumMNM|Ch( nRg&AMwoE%!_MF><{44@e