From a0024a66feda939e271bf30a5e6ea57851b03271 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 16 Dec 2021 10:09:17 -0800 Subject: session: improve sh segment-manager cli Type: improvement Signed-off-by: Florin Coras Change-Id: I5d669fcba609bcdb35103f57c45e0a270213d84a --- src/svm/fifo_segment.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/svm') diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c index 48d019c9aac..8795b46c86a 100644 --- a/src/svm/fifo_segment.c +++ b/src/svm/fifo_segment.c @@ -1536,22 +1536,15 @@ format_fifo_segment (u8 * s, va_list * args) f64 usage; fifo_segment_mem_status_t mem_st; - indent = format_get_indent (s) + 2; - - if (fs == 0) - { - s = format (s, "%-20s%10s%15s%15s%15s%15s", "Name", "Type", - "HeapSize (M)", "ActiveFifos", "FreeFifos", "Address"); - return s; - } + indent = format_get_indent (s); fifo_segment_info (fs, &address, &size); active_fifos = fifo_segment_num_fifos (fs); free_fifos = fifo_segment_num_free_fifos (fs); - s = format (s, "%-20v%10U%15llu%15u%15u%15llx", ssvm_name (&fs->ssvm), - format_fifo_segment_type, fs, size >> 20ULL, active_fifos, - free_fifos, address); + s = format (s, "%U%v type: %U size: %U active fifos: %u", format_white_space, + 2, ssvm_name (&fs->ssvm), format_fifo_segment_type, fs, + format_memory_size, size, active_fifos); if (!verbose) return s; @@ -1560,9 +1553,8 @@ format_fifo_segment (u8 * s, va_list * args) free_chunks = fifo_segment_num_free_chunks (fs, ~0); if (free_chunks) - s = - format (s, "\n\n%UFree/Allocated chunks by size:\n", format_white_space, - indent + 2); + s = format (s, "\n\n%UFree/Allocated chunks by size:\n", + format_white_space, indent + 2); else s = format (s, "\n"); -- cgit 1.2.3-korg