bufmon: add buffer monitoring plugin

This plugin allow to keep track of buffer usage in VPP graph nodes. The
main use is to detect buffer leakages.

Type: feature

Change-Id: Iadcf4ab98207fab6e2fa375060879bc2a25b711e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
This commit is contained in:
Benoît Ganne
2021-03-09 15:37:49 +01:00
committed by Damjan Marion
parent a13100f3aa
commit e09a2337b8
8 changed files with 422 additions and 24 deletions

View File

@@ -0,0 +1,17 @@
# Copyright (c) 2020 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_vpp_plugin(bufmon
SOURCES
bufmon.c
)

View File

@@ -0,0 +1,8 @@
---
name: Buffers monitoring plugin
maintainer: Benoît Ganne <bganne@cisco.com>
features:
- monitor buffer utiization in VPP graph nodes
description: "monitor buffer utiization in VPP graph nodes"
state: production
properties: [CLI, MULTITHREAD]

313
src/plugins/bufmon/bufmon.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
# Buffers monitoring plugin {#bufmon_doc}
This plugin enables to track buffer utilization in the VPP graph nodes. The
main use is to detect buffer leakage.
It works by keeping track of number of buffer allocations and free in graph
nodes and also of number of buffers received in input frames and in output
frames.
The formula to compute the number of "buffered" buffers in a node is simply:
#buffered = #alloc + #input - #free - #output
Note: monitoring will impact performances.
## Basic usage
1. Turn buffer traces on:
```
~# vppctl set buffer traces on
```
2. Monitor buffer usage:
```
~# vppctl show buffer traces verbose
```
3. Turn buffer traces off:
```
~# vppctl set buffer traces off
```