aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyujiro Shibuya <ryujiro.shibuya@owmobility.com>2020-03-26 07:29:09 +0000
committerFlorin Coras <florin.coras@gmail.com>2020-03-26 14:15:47 +0000
commit65c30ceb92dd79c7b00e8c31119db98d473dbfbb (patch)
tree1e9a5a4f1cc7941dbcdb5faa9d8a259f5f444519
parent33c9931cb4108a8394420fcae5d4c8f9ea0f367f (diff)
svm: correct format_fifo_segment
Type: improvement Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: Ia8aef3695f12e09b087be79ebe40e758fb8105ad
-rw-r--r--src/svm/fifo_segment.c7
-rw-r--r--src/vnet/session/segment_manager.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c
index 5d374384a33..f2890cc0bce 100644
--- a/src/svm/fifo_segment.c
+++ b/src/svm/fifo_segment.c
@@ -1308,12 +1308,13 @@ format_fifo_segment_type (u8 * s, va_list * args)
u8 *
format_fifo_segment (u8 * s, va_list * args)
{
- u32 count, indent, active_fifos, free_fifos, fifo_hdr = 0;
+ u32 count, indent, active_fifos, free_fifos;
fifo_segment_t *fs = va_arg (*args, fifo_segment_t *);
int verbose __attribute__ ((unused)) = va_arg (*args, int);
uword est_chunk_bytes, est_free_seg_bytes, free_chunks;
uword chunk_bytes = 0, free_seg_bytes, chunk_size;
uword tracked_cached_bytes;
+ uword fifo_hdr = 0, reserved;
fifo_segment_header_t *fsh;
fifo_segment_slice_t *fss;
svm_fifo_chunk_t *c;
@@ -1389,13 +1390,13 @@ format_fifo_segment (u8 * s, va_list * args)
usage = (100.0 * in_use) / allocated;
mem_st = fifo_segment_get_mem_status (fs);
virt = fsh_virtual_mem (fsh);
+ reserved = fsh->n_reserved_bytes;
s = format (s, "\n%Useg free bytes: %U (%lu) estimated: %U (%lu) reserved:"
" %U (%lu)\n", format_white_space, indent + 2,
format_memory_size, free_seg_bytes, free_seg_bytes,
format_memory_size, est_free_seg_bytes, est_free_seg_bytes,
- format_memory_size, fsh->n_reserved_bytes,
- fsh->n_reserved_bytes);
+ format_memory_size, reserved, reserved);
s = format (s, "%Uchunk free bytes: %U (%lu) estimated: %U (%lu) tracked:"
" %U (%lu)\n", format_white_space, indent + 2,
format_memory_size, chunk_bytes, chunk_bytes,
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 02ac1c081c3..ad5db656c77 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -843,6 +843,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input,
{
segment_manager_main_t *smm = &sm_main;
u8 show_segments = 0, verbose = 0;
+ uword max_fifo_size;
segment_manager_t *sm;
fifo_segment_t *seg;
app_worker_t *app_wrk;
@@ -872,11 +873,12 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input,
app_wrk = app_worker_get_if_valid (sm->app_wrk_index);
app = app_wrk ? application_get (app_wrk->app_index) : 0;
custom_logic = (app && (app->cb_fns.fifo_tuning_callback)) ? 1 : 0;
+ max_fifo_size = sm->max_fifo_size;
vlib_cli_output (vm, "%-6d%=10d%=10d%=13U%=11d%=11d%=12s",
segment_manager_index (sm),
sm->app_wrk_index, pool_elts (sm->segments),
- format_memory_size, sm->max_fifo_size,
+ format_memory_size, max_fifo_size,
sm->high_watermark, sm->low_watermark,
custom_logic ? "custom" : "none");
}));