aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/stats
AgeCommit message (Collapse)AuthorFilesLines
2022-03-09stats: refactorDamjan Marion4-1536/+0
Type: refactor Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10stats: Remove unsolicited clib_warningSteven Luong1-1/+1
It is annoying to see unsolicited message like this spew out to the console which an end-user cares less about. vlib_stats_rename_symlink:301: RENAME new name: /nodes/unix-cli-local:52/clocks Type: fix Fixes: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I071f3d3736c06cd95a38ec46c7e2222caad01283
2022-02-06stats: fix memory leaksOle Troan1-32/+66
Type: fix Fixes: 72e31bc2d9 Fixes: db02380 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a Signed-off-by: Ole Troan <ot@cisco.com>
2021-10-13docs: convert vpp doc md->rstNathan Skrzypczak2-130/+178
Type: improvement Change-Id: If453321785b04f9c16e8cea36fb1910efaeb2c59 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-23stats: revert stat_validate_counter_vector3 non-staticRay Kinsella2-4/+1
This reverts commit c30157811e4c8e870d2680b08ecd3a38dff2d53b. Type: refactor Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Id011c8e5acb1613e09fd339ce614159c0acd651a
2021-09-09stats: revert enable/disable segments pollsRay Kinsella3-29/+16
This reverts commit 034bd1067eddb700c6d2bc67974056fe00012310. Type: refactor Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Icce6052d6cf9616f7eac3185b4c9aace234aa59f
2021-08-31stats: enable/disable segments pollsRay Kinsella3-19/+32
Add an enable/disable field to stats segments poll. The is used by the perfmon plugin to only poll for stats on an active bundle. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I6404a7db50d8e922afea5da8ec15fdabe3d97157
2021-08-31stats: stat_validate_counter_vector3 non-staticRay Kinsella2-1/+4
Make stat_validate_counter_vector3 usable outside of stats segement. Is used by the perfmon plugin to allocate a 2-dimension array of values. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: If4be2e14ba718c20bf939d162e580880eab1a6cb
2021-06-16stats: fix counters name overflowBenoît Ganne1-6/+6
sm_directory_vector_by_name is a C-string hashtable, make sure the names are NULL-terminated. Type: fix Change-Id: If44456ef9da69ed012f2b981b58ce732663af67d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-05-21nat: add maximum configured sessions to stat segmentOle Troan1-1/+2
Add /nat44-ed/max-cfg-sessions gauge. Reflects the configured value for configured sessions (per thread). Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I618c8aa0daab0981399cfe9273d191fa1990ef60 Signed-off-by: Ole Troan <ot@cisco.com>
2021-05-06stats: move vector_rate counters into providerOle Troan3-66/+96
Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Iae1fb59a6dc9679c0fa0b87fa5232d551a7995a5
2021-05-06stats: memory heap countersOle Troan3-87/+228
- Add counters for the main-heap - Add additional counters per heap: STAT_MEM_TOTAL STAT_MEM_USED, STAT_MEM_FREE, STAT_MEM_USED_MMAP, STAT_MEM_TOTAL_ALLOC, STAT_MEM_FREE_CHUNKS, STAT_MEM_RELEASABLE, The per-heap counters are organised as a two dimensional vector. total, used and free are directly available via symlinks. vpp_get_stats ls "^/mem/" /mem/stat segment /mem/stat segment/total /mem/stat segment/used /mem/stat segment/free /mem/main heap /mem/main heap/total /mem/main heap/used /mem/main heap/free vpp_get_stats dump "^/mem/main\ heap$" [0 @ 0]: 1073741776 packets /mem/main heap [1 @ 0]: 91586688 packets /mem/main heap [2 @ 0]: 982155088 packets /mem/main heap [3 @ 0]: 0 packets /mem/main heap [4 @ 0]: 1073741776 packets /mem/main heap [5 @ 0]: 433 packets /mem/main heap [6 @ 0]: 981708688 packets /mem/main heap Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I36725dde3b4b3befd27a8b4d3ba931f2d3b627cc
2021-05-04stats: adding symlinks for nodes and interfaces in the stat segmentArthur de Kerhor3-45/+201
A given interface counter (e.g rx) can be accessed via /interfaces/<interface_name>/<counter_name>. Same goes with nodes: /nodes/<node_name>/<counter_name> As interfaces may contain '/' in their names, these are replaced by '_' in symlinks Also added 2 tests for the stat segment Type: feature Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com> Change-Id: I27da252e7b3dc177815616ca46b5c200a456bf0f Signed-off-by: Ole Troan <ot@cisco.com>
2021-04-18vppinfra: remove linux/syscall.hDamjan Marion1-2/+0
For portabiliy reasons it is better to have all wrapped in clib code. I.e. instead of using getcpu() we have clib_get_current_numa_node () and clib_get_current_cpu_id(). Type: refactor Change-Id: I29b52d7f29bc7f93873402c4070561f564b71c63 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion1-3/+2
Type: refactor Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-2/+2
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-02-16stats: coverity errors leaking fdOle Troan1-1/+4
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I21368e37d70c5a64babd904bcf5f79339a5ab064 Signed-off-by: Ole Troan <ot@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-3/+3
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-04stats: fix coverity issuesAndrew Yourtchenko1-4/+3
Usage of the possibly negative value with subsequent check on it makes coverity very unhappy, so put the check before use. Change-Id: I731fbe6246f9e4212d546fd9277bc1ddcd3c2ec1 Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-10-21stats: missing dimension in stat_set_simple_counterOle Troan1-1/+2
A simple counter is a two dimensional array by threads and counter index. 28017 introduced an error missing the first dimension. If a vector is updated at the same time as a client reads, an invalid pointer my result. This will be caught by the optimistic locking after copying out the data, but if following a pointer outside of the stat segment then the stat client would crash. Add suitable boundary checks for access to stat memory segment. Fixes: 7d29e320fb2855a1ddb7a6af09078b8ed636de01 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I94f124ec71d98218c4eda5d124ac5594743d93d6
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion1-7/+7
- it is confusing from end consumer perspective that some thing is somewhere called heap and somewhere mspace - this is base for additional work where heap pointer is not the same thing like mspace Type: improvement Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17stats: configurable page sizeDamjan Marion2-13/+22
Type: improvement Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-08-13stats: remove offsets on vpp sideOle Troan3-142/+31
Represent pointers directly in shared memory and require clients to adjust for shared memory segment being mapped at different base address. Deprecated: stat_segment_pointer() / stat_segment_offset() Added: stat_segment_adjust() Bumped the stat segment version to 2. Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I33e756187b8903b45dcd353e6c1a101b7a4acb79
2020-07-21stats: memory leak in stat_validate_counter_vectorSteven Luong1-2/+10
Free the existing vectors prior to losing them. Type: fix Ticket: VPPSUPP-94 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic15f1fbc7a0c6c348065fc9759ee5d5c43013b91 Signed-off-by: Ole Troan <ot@cisco.com>
2020-04-28stats: add apis to delete simple/combined countersOle Troan1-0/+39
vlib_free_simple_counter() vlib_free_combined_counter() Frees the name and two dimensional vector from the stats segment. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948
2020-02-11vppinfra: remove the historical mheap memory allocatorDave Barach1-8/+0
The mheap allocator has been turned off for several releases. This commit removes the cmake config parameter, parallel support for dlmalloc and mheap, and the mheap allocator itself. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I104f88a1f06e47e90e5f7fb3e11cd1ca66467903
2020-02-05stats: fix state counter removalVladimir Isaev3-45/+116
Avoid using vec_del1() for directory vector to keep indexes valid all the time. There are state counters for each slave in LACP bond mode which can be dynamically created and removed. Vector index is used to access these counters. But also vec_del1() is used to remove counter from vector. This function changes the index of the last element, so after this we are unable to access ex-last element using old index. As a result it is not possible to add-del-add two interfaces to the LACP bond: DBGvpp# create bond mode lacp BondEthernet0 DBGvpp# create packet-generator interface pg1 DBGvpp# create packet-generator interface pg2 DBGvpp# bond add BondEthernet0 pg1 DBGvpp# bond add BondEthernet0 pg2 DBGvpp# bond del pg1 DBGvpp# bond del pg2 DBGvpp# bond add BondEthernet0 pg1 DBGvpp# bond add BondEthernet0 pg2 bond add: /if/lacp/1/3/partner-state is already register Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: I2c86e13905eefdef6233369cd4ab5c1b53d123bd
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
Type: fix Since CentOS 8, RPM build script doesn't accept '#!/usr/bin/env python' as a valid shebang line. It requires scripts to explicitly chose between python2 or python3. Change all to use python3 as suggested by Paul Vinciguerra. Depends-On: https://gerrit.fd.io/r/23170 Signed-off-by: Renato Botelho do Couto <renato@netgate.com> Change-Id: Ie72af9f60fd0609e07f05b70f8d96e738b2754d1
2019-10-02vlib: improve summary vector-rate statisticsDave Barach2-24/+41
Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I4b77879b0a84fdec3c1518a972cf003d5135222d Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-30stats: fix per-worker stat vector lengthBenoît Ganne1-3/+4
Type: fix Change-Id: I198a2312f5fc6e922c8a6c51ba7248ce6e236f81 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-18stats: fix per_worker vector rate heapOle Troan1-3/+7
The per_worker counters were outside of the stats heap. Also fixes the length of the per_vector counter. A simple vector is two dimensional including a thread dimension. Fixes: f89a6de8f0 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I370bf9cb033d264f42df2723e01b768dc270792b
2019-09-04stats: add /if/<n>/<n>/state for lacp interface stateSteven Luong2-1/+76
Add /if/lacp/<bond-sw_if_index>/<slave-sw_if_index>/state <bond-sw_if_index> is a vector of the bond sw_if_index <slave-sw_if_index> is a vector of the slave sw_if_index Content is the integer value of the lacp actor state. The state is actually a bitfield as described in the lacp protocol spec. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic6eca8ce2a1acd2d858e4e50b7eac1d000ea08e5 Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-03stats: memory leak with per-node-counters onOle Troan1-0/+3
vlib_node_get_nodes() creates a duplicate node structure which was never freed. Type: fix Fixes: 1ddbc0138b Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib1200854937faaa694b398607d2f0ba65aa81c01
2019-08-29stats: null-terminate default socket nameBenoît Ganne1-2/+2
Type: fix Fixes: d991a798ff Change-Id: I1920a40d7bbb01593676d9d8564158fdba9452bb Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-08-20vlib: create unix runtime directoryOle Troan1-8/+24
Ensure the runtime directory is created at startup. Default /run/vpp Type: fix Fixes: I53d70939c8125d04a365ac51a6cbf8926dc52adf Change-Id: I6d70364ea756b86768c4dd1f6a9383238ed275c8 Signed-off-by: Ole Troan <ot@cisco.com>
2019-08-15stats: refactor header filesDave Barach2-33/+61
Performant stat segment scraping involves caching the results of stat_segment_ls (...) and directly fishing counter data from the shared-memory segment. To do that, we need to publish several things previously hidden, declared in stat_client.c: o stat_client_main_t typedef o stat_segment_access_t typedef o stat_segment_access_start inline function o stat_segment_access_end inline function Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3175e3d1f1fd8ea816336a584565179d1972115c
2019-08-09stats: create /run/vpp before stat socket bind()YohanPipereau1-33/+11
When VPP tries to bind to stats.sock it will complain about non-existing /run/vpp directory. /run/vpp is created before cli socket operations are performed. The same should be done for stat socket. Ticket: VPP-1708 Type: fix Change-Id: I53d70939c8125d04a365ac51a6cbf8926dc52adf Signed-off-by: YohanPipereau <ypiperea@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2019-07-22stats: fix use-after-free hash key stringBenoît Ganne1-6/+4
Hash keys are not copied by the hash infrastructure, instead the pointer is used directly. stat_segment_register_gauge() does not allocate a private object for the key, causing issues when it is freed or reused. Allocate a private object on insertion into the hashtable instead. Type: fix Fixes: 92e3082199d10add866894e86a9762d79a3536c4 Change-Id: Ifb6addfcaec81bdb7ea3512050ce55f06ef09a4c Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-06-18stats: off by one error in /sys/node/{calls,clocks,...}Ole Troan1-4/+4
Fixes: 58492a8372 Change-Id: Ia2eeebc2488b57e57f8d5e52f9948d1cced7b6fc Type: fix Ticket: VPP-1698 Signed-off-by: Ole Troan <ot@cisco.com>
2019-06-18stats: fix memory leakage when adding / deleting interfacesOle Troan2-17/+57
This fixes two leaks in registering errors in the stats segment. - The error name created by vlib_register_errors() was not freed. - Duplicate error names (when interface readded) was added to the vector. This fix also adds memory usage statistics for the statistics segment as /mem/statseg/{used, total} Change-Id: Ife98d5fc5baef5bdae426a5a1eef428af2b9ab8a Type: fix Signed-off-by: Ole Troan <ot@cisco.com>
2019-06-14stats: add version field to stat segment base headerOle Troan2-0/+7
Add a version in the base header of the stat segment To make support for multiple reader implementations safer. Change-Id: I6816e2a51a98c2df1e621e80d4ef0b4ba4e9f47b Type: feature Signed-off-by: Ole Troan <ot@cisco.com>
2019-06-07build: add -Wall and -fno-common, fix reported issuesBenoît Ganne1-10/+3
Type: refactor Change-Id: I8489ccd54411c2aa9355439c5641dc31012c64a2 Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-04stats: removing empty object in stats vectorOle Troan1-1/+1
Type: fix Change-Id: I9b6bdacdb9a0750834de9a93d8c3f7ed827ce3c8 Signed-off-by: Ole Troan <ot@cisco.com>
2019-05-23stats: fix memory leak in statseg configDave Wallace1-12/+18
Type: fix Change-Id: I383d5b189efc90ad418725b7e52888138dee0f75 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-05-22stats: support multiple works for error countersOle Troan3-5/+15
The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan <ot@cisco.com>
2019-05-16init / exit function orderingDave Barach1-6/+8
The vlib init function subsystem now supports a mix of procedural and formally-specified ordering constraints. We should eliminate procedural knowledge wherever possible. The following schemes are *roughly* equivalent: static clib_error_t *init_runs_first (vlib_main_t *vm) { clib_error_t *error; ... do some stuff... if ((error = vlib_call_init_function (init_runs_next))) return error; ... } VLIB_INIT_FUNCTION (init_runs_first); and static clib_error_t *init_runs_first (vlib_main_t *vm) { ... do some stuff... } VLIB_INIT_FUNCTION (init_runs_first) = { .runs_before = VLIB_INITS("init_runs_next"), }; The first form will [most likely] call "init_runs_next" on the spot. The second form means that "init_runs_first" runs before "init_runs_next," possibly much earlier in the sequence. Please DO NOT construct sets of init functions where A before B actually means A *right before* B. It's not necessary - simply combine A and B - and it leads to hugely annoying debugging exercises when trying to switch from ad-hoc procedural ordering constraints to formal ordering constraints. Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-15Fix stats documentation with default socket nameIgor Mikhailov (imichail)1-2/+2
Change-Id: Ibcb726c229cc12705764f771c15110852b420c49 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2019-05-10Fix stat seg average vector rate computationDave Barach2-14/+53
Add the number of worker threads and per worker thread vector rates to the stats segment. Change-Id: I3040108ec9fcdf5fdb6b9a950060dea9b3c88fd1 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2019-04-30stats: fix non null terminated stringBenoît Ganne1-0/+5
Change-Id: I08e490d9e955072eff20d0141598157d995bcb56 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-04-19Doxygen cleanup.Dave Wallace1-1/+1
- Add subpages definitions in appropriate section (User or Dev docs) for doc files (*.rst, *.md) that being listed at the top level of the generated doc page. - Generate and add API list to RELEASE doc. - Fix list_api_changes script to use HEAD as the endtag so it doesn't need to be changed every release. Change-Id: Iace7b6433359c6b96869cb1db01facbbcb0ac1e6 Signed-off-by: Dave Wallace <dwallacelf@gmail.com> (cherry picked from commit 11ee93f6abfaddf5bbd56cf0858c0c6ea0384b65)