.. _clicmd_src_vlib:

===============================================================
VLIB application library
===============================================================

clear
-------------------------------------------------------------------------

.. code-block:: console

    Clear commands


Declaration: ``vlib_cli_clear_command`` `src/vlib/cli.c line 65 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L65>`_


clear errors
-------------------------------------------------------------------------

.. code-block:: console

    Clear error counters


Declaration: ``cli_clear_error_counters`` `src/vlib/error.c line 394 <https://github.com/FDio/vpp/blob/master//src/vlib/error.c#L394>`_

Implementation: ``clear_error_counters``


clear logging
-------------------------------------------------------------------------

.. code-block:: console

    clear logging


Declaration: ``cli_clear_log`` `src/vlib/log.c line 482 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L482>`_

Implementation: ``clear_log``


clear node counters
-------------------------------------------------------------------------

.. code-block:: console

    Clear node counters


Declaration: ``cli_clear_node_counters`` `src/vlib/error.c line 400 <https://github.com/FDio/vpp/blob/master//src/vlib/error.c#L400>`_

Implementation: ``clear_error_counters``


clear runtime
-------------------------------------------------------------------------

.. code-block:: console

    Clear packet processing runtime statistics


Declaration: ``clear_node_runtime_command`` `src/vlib/node_cli.c line 669 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L669>`_

Implementation: ``clear_node_runtime``


clear trace
-------------------------------------------------------------------------

.. code-block:: console

    Clear trace buffer and free memory


Declaration: ``clear_trace_cli`` `src/vlib/trace.c line 584 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L584>`_

Implementation: ``cli_clear_trace_buffer``


event-logger clear
-------------------------------------------------------------------------

.. code-block:: console

    Clear the event log


Declaration: ``elog_clear_cli`` `src/vlib/main.c line 638 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L638>`_

Implementation: ``vlib_cli_elog_clear``


event-logger resize
-------------------------------------------------------------------------

.. code-block:: console

    event-logger resize <nnn>


Declaration: ``elog_resize_cli`` `src/vlib/main.c line 755 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L755>`_

Implementation: ``elog_resize_command_fn``


event-logger restart
-------------------------------------------------------------------------

.. code-block:: console

    Restart the event-logger


Declaration: ``elog_restart_cli`` `src/vlib/main.c line 727 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L727>`_

Implementation: ``elog_restart``


event-logger save
-------------------------------------------------------------------------

.. code-block:: console

    event-logger save <filename> (saves log in /tmp/<filename>)


Declaration: ``elog_save_cli`` `src/vlib/main.c line 691 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L691>`_

Implementation: ``elog_save_buffer``


event-logger stop
-------------------------------------------------------------------------

.. code-block:: console

    Stop the event-logger


Declaration: ``elog_stop_cli`` `src/vlib/main.c line 709 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L709>`_

Implementation: ``elog_stop``


event-logger trace
-------------------------------------------------------------------------

.. code-block:: console

    event-logger trace [api][cli][barrier][dispatch]
    [circuit-node <name> e.g. ethernet-input][disable]



Control event logging of api, cli, and thread barrier events
With no arguments, displays the current trace status.
Name the event groups you wish to trace or stop tracing.



.. code-block:: console

    
    event-logger trace api cli barrier
    event-logger trace api cli barrier disable
    event-logger trace dispatch
    event-logger trace circuit-node ethernet-input
    




.. code-block:: console

    event-logger trace [api][cli][barrier][disable]



Declaration: ``event_logger_trace_command`` `src/vlib/cli.c line 1732 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1732>`_

Implementation: ``event_logger_trace_command_fn``


memory-trace
-------------------------------------------------------------------------

.. code-block:: console

    memory-trace on|off [api-segment][stats-segment][main-heap]
                       [numa-heap <numa-id>]
    


Declaration: ``enable_disable_memory_trace_command`` `src/vlib/cli.c line 1111 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1111>`_

Implementation: ``enable_disable_memory_trace``


restart
-------------------------------------------------------------------------

.. code-block:: console

    restart process


Declaration: ``restart_cmd`` `src/vlib/cli.c line 1247 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1247>`_

Implementation: ``restart_cmd_fn``


save memory-trace
-------------------------------------------------------------------------

.. code-block:: console

    save memory-trace <filename>



Save memory traces of the currently traced heap in JSON format to file.
Only filename can be specified, path is fixed (/tmp/<filename>).



.. code-block:: console

    save memory-trace mem_trace.json



Declaration: ``save_memory_trace_command`` `src/vlib/cli.c line 1217 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1217>`_

Implementation: ``save_memory_trace``


set
-------------------------------------------------------------------------

.. code-block:: console

    Set commands


Declaration: ``vlib_cli_set_command`` `src/vlib/cli.c line 71 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L71>`_


set clock adjust
-------------------------------------------------------------------------

.. code-block:: console

    set clock adjust <nn>


Declaration: ``vlib_time_virtual_command`` `src/vlib/time.c line 80 <https://github.com/FDio/vpp/blob/master//src/vlib/time.c#L80>`_

Implementation: ``vlib_time_virtual_adjust_command_fn``


set logging class
-------------------------------------------------------------------------

.. code-block:: console

    set logging class <class> [rate-limit <int>] [level <level>] [syslog-level <level>]


Declaration: ``cli_set_log`` `src/vlib/log.c line 614 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L614>`_

Implementation: ``set_log_class``


set logging size
-------------------------------------------------------------------------

.. code-block:: console

    set logging size <int>


Declaration: ``cli_set_log_size`` `src/vlib/log.c line 680 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L680>`_

Implementation: ``set_log_size``


set logging unthrottle-time
-------------------------------------------------------------------------

.. code-block:: console

    set logging unthrottle-time <int>


Declaration: ``cli_set_log_params`` `src/vlib/log.c line 646 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L646>`_

Implementation: ``set_log_unth_time``


set node function
-------------------------------------------------------------------------

.. code-block:: console

    set node function <node-name> <variant-name>


Declaration: ``set_node_fn_command`` `src/vlib/node_cli.c line 887 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L887>`_

Implementation: ``set_node_fn``


set trace filter function
-------------------------------------------------------------------------

.. code-block:: console

    set trace filter function <func_name>


Declaration: ``set_trace_filter_function_cli`` `src/vlib/trace.c line 740 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L740>`_

Implementation: ``set_trace_filter_function``


show
-------------------------------------------------------------------------

.. code-block:: console

    Show commands


Declaration: ``vlib_cli_show_command`` `src/vlib/cli.c line 59 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L59>`_


show buffers
-------------------------------------------------------------------------

.. code-block:: console

    Show packet buffer allocation


Declaration: ``show_buffers_command`` `src/vlib/buffer.c line 638 <https://github.com/FDio/vpp/blob/master//src/vlib/buffer.c#L638>`_

Implementation: ``show_buffers``


show cli
-------------------------------------------------------------------------

.. code-block:: console

    show cli [mp-safe][not-mp-safe][hit][clear-hit]



Displays debug cli command information



.. code-block:: console

    show cli [mp-safe][not-mp-safe][hit][clear-hit]
    
    
    "show cli" displays the entire debug cli:
    
    abf attach
    abf policy
    adjacency counters
    api trace
    app ns
    bfd key del
    ... and so on ...
    
    "show cli mp-safe" displays mp-safe debug CLI commands:
    
    abf policy
    binary-api
    create vhost-user
    exec
    ip container
    ip mroute
    ip probe-neighbor
    ip route
    ip scan-neighbor
    ip table
    ip6 table
    
    "show cli not-mp-safe" displays debug CLI commands
    which cause worker thread barrier synchronization
    
    "show cli hit" displays commands which have been executed. Qualify
    as desired with "mp-safe" or "not-mp-safe".
    
    "show cli clear-hit" clears the per-command hit counters.
    



Declaration: ``show_cli_command`` `src/vlib/cli.c line 1945 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1945>`_

Implementation: ``show_cli_command_fn``


show clock
-------------------------------------------------------------------------

.. code-block:: console

    show clock


Declaration: ``f_command`` `src/vlib/threads.c line 1784 <https://github.com/FDio/vpp/blob/master//src/vlib/threads.c#L1784>`_

Implementation: ``show_clock_command_fn``


show cpu
-------------------------------------------------------------------------

.. code-block:: console

    Show cpu information



Displays various information about the CPU.



.. code-block:: console

    show cpu
    
    Model name:               Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
    Microarchitecture:        Broadwell (Broadwell-EP/EX)
    Flags:                    sse3 ssse3 sse41 sse42 avx avx2 aes
    Base Frequency:           3.20 GHz
    



Declaration: ``show_cpu_command`` `src/vlib/cli.c line 999 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L999>`_

Implementation: ``show_cpu``


show errors
-------------------------------------------------------------------------

.. code-block:: console

    Show error counts


Declaration: ``vlib_cli_show_errors`` `src/vlib/error.c line 365 <https://github.com/FDio/vpp/blob/master//src/vlib/error.c#L365>`_

Implementation: ``show_errors``


show event-logger
-------------------------------------------------------------------------

.. code-block:: console

    Show event logger info


Declaration: ``elog_show_cli`` `src/vlib/main.c line 812 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L812>`_

Implementation: ``elog_show_buffer``


show frame-queue
-------------------------------------------------------------------------

.. code-block:: console

    show frame-queue trace


Declaration: ``cmd_show_frame_queue_trace`` `src/vlib/threads_cli.c line 362 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L362>`_

Implementation: ``show_frame_queue_trace``


show frame-queue histogram
-------------------------------------------------------------------------

.. code-block:: console

    show frame-queue histogram


Declaration: ``cmd_show_frame_queue_histogram`` `src/vlib/threads_cli.c line 368 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L368>`_

Implementation: ``show_frame_queue_histogram``


show logging
-------------------------------------------------------------------------

.. code-block:: console

    show logging


Declaration: ``cli_show_log`` `src/vlib/log.c line 407 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L407>`_

Implementation: ``show_log``


show logging configuration
-------------------------------------------------------------------------

.. code-block:: console

    show logging configuration


Declaration: ``cli_show_log_config`` `src/vlib/log.c line 453 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L453>`_

Implementation: ``show_log_config``


show memory
-------------------------------------------------------------------------

.. code-block:: console

    show memory [api-segment][stats-segment][verbose]
                [numa-heaps][map][main-heap]


Declaration: ``show_memory_usage_command`` `src/vlib/cli.c line 967 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L967>`_

Implementation: ``show_memory_usage``


show node
-------------------------------------------------------------------------

.. code-block:: console

    show node [index] <node-name | node-index>


Declaration: ``show_node_command`` `src/vlib/node_cli.c line 835 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L835>`_

Implementation: ``show_node``


show node counters
-------------------------------------------------------------------------

.. code-block:: console

    Show node counters


Declaration: ``cli_show_node_counters`` `src/vlib/error.c line 371 <https://github.com/FDio/vpp/blob/master//src/vlib/error.c#L371>`_

Implementation: ``show_errors``


show physmem
-------------------------------------------------------------------------

.. code-block:: console

    show physmem [verbose | detail | map]


Declaration: ``show_physmem_command`` `src/vlib/physmem.c line 165 <https://github.com/FDio/vpp/blob/master//src/vlib/physmem.c#L165>`_

Implementation: ``show_physmem``


show punt client
-------------------------------------------------------------------------

.. code-block:: console

    show client[s] registered with the punt infra


Declaration: ``punt_client_show_command`` `src/vlib/punt.c line 605 <https://github.com/FDio/vpp/blob/master//src/vlib/punt.c#L605>`_

Implementation: ``punt_client_show``


show punt db
-------------------------------------------------------------------------

.. code-block:: console

    show the punt DB


Declaration: ``punt_db_show_command`` `src/vlib/punt.c line 665 <https://github.com/FDio/vpp/blob/master//src/vlib/punt.c#L665>`_

Implementation: ``punt_db_show``


show punt reasons
-------------------------------------------------------------------------

.. code-block:: console

    show all punt reasons


Declaration: ``punt_reason_show_command`` `src/vlib/punt.c line 626 <https://github.com/FDio/vpp/blob/master//src/vlib/punt.c#L626>`_

Implementation: ``punt_reason_show``


show punt stats
-------------------------------------------------------------------------

.. code-block:: console

    show the punt stats


Declaration: ``punt_stats_show_command`` `src/vlib/punt.c line 690 <https://github.com/FDio/vpp/blob/master//src/vlib/punt.c#L690>`_

Implementation: ``punt_stats_show``


show runtime
-------------------------------------------------------------------------

.. code-block:: console

    Show packet processing runtime


Declaration: ``show_node_runtime_command`` `src/vlib/node_cli.c line 616 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L616>`_

Implementation: ``show_node_runtime``


show threads
-------------------------------------------------------------------------

.. code-block:: console

    Show threads


Declaration: ``show_threads_command`` `src/vlib/threads_cli.c line 88 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L88>`_

Implementation: ``show_threads_fn``


show trace
-------------------------------------------------------------------------

.. code-block:: console

    Show trace buffer [max COUNT]


Declaration: ``show_trace_cli`` `src/vlib/trace.c line 356 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L356>`_

Implementation: ``cli_show_trace_buffer``


show trace filter function
-------------------------------------------------------------------------

.. code-block:: console

    show trace filter function


Declaration: ``show_trace_filter_function_cli`` `src/vlib/trace.c line 672 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L672>`_

Implementation: ``show_trace_filter_function``


show vlib frame-allocation
-------------------------------------------------------------------------

.. code-block:: console

    Show node dispatch frame statistics


Declaration: ``show_frame_stats_cli`` `src/vlib/main.c line 243 <https://github.com/FDio/vpp/blob/master//src/vlib/main.c#L243>`_

Implementation: ``show_frame_stats``


show vlib graph
-------------------------------------------------------------------------

.. code-block:: console

    Show packet processing node graph


Declaration: ``show_node_graph_command`` `src/vlib/node_cli.c line 88 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L88>`_

Implementation: ``show_node_graph``


show vlib graphviz
-------------------------------------------------------------------------

.. code-block:: console

    Dump packet processing node graph as a graphviz dotfile



Dump dot files data to draw a graph of all the nodes.
If the argument 'filter' is provided, only the active nodes (since the last
"clear run" command) are selected and they are scaled and colored according
to their utilization. You can choose to filter nodes that are called,
nodes that receive vectors or both (default).
The 'file' option allows to save data in a temp file.



.. code-block:: console

    
    show vlib graphviz
    show vlib graphviz filter file tmpfile
    show vlib graphviz filter calls file tmpfile
    




.. code-block:: console

    show vlib graphviz [filter][calls][vectors][file <filename>]



Declaration: ``show_node_graphviz_command`` `src/vlib/node_cli.c line 325 <https://github.com/FDio/vpp/blob/master//src/vlib/node_cli.c#L325>`_

Implementation: ``show_node_graphviz``


suspend
-------------------------------------------------------------------------

.. code-block:: console

    suspend debug CLI for 30ms


Declaration: ``suspend_command`` `src/vlib/cli.c line 1748 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1748>`_

Implementation: ``suspend_command_fn``


test
-------------------------------------------------------------------------

.. code-block:: console

    Test commands


Declaration: ``vlib_cli_test_command`` `src/vlib/cli.c line 77 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L77>`_


test frame-queue nelts
-------------------------------------------------------------------------

.. code-block:: console

    test frame-queue nelts (4,8,16,32)


Declaration: ``cmd_test_frame_queue_nelts`` `src/vlib/threads_cli.c line 441 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L441>`_

Implementation: ``test_frame_queue_nelts``


test frame-queue threshold
-------------------------------------------------------------------------

.. code-block:: console

    test frame-queue threshold N (0=no limit)


Declaration: ``cmd_test_frame_queue_threshold`` `src/vlib/threads_cli.c line 518 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L518>`_

Implementation: ``test_frame_queue_threshold``


test log
-------------------------------------------------------------------------

.. code-block:: console

    test log <level> <class> <subclass> <message>


Declaration: ``cli_test_log`` `src/vlib/log.c line 757 <https://github.com/FDio/vpp/blob/master//src/vlib/log.c#L757>`_

Implementation: ``test_log_class_subclass``


test sleep
-------------------------------------------------------------------------

.. code-block:: console

    Sleep for 10 seconds


Declaration: ``ping_command`` `src/vlib/cli.c line 1277 <https://github.com/FDio/vpp/blob/master//src/vlib/cli.c#L1277>`_

Implementation: ``sleep_ten_seconds``


trace
-------------------------------------------------------------------------

.. code-block:: console

    Packet tracer commands


Declaration: ``trace_cli_command`` `src/vlib/trace.c line 176 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L176>`_


trace add
-------------------------------------------------------------------------

.. code-block:: console

    trace add <input-graph-node> <add'l-pkts-for-node-> [filter] [verbose]


Declaration: ``add_trace_cli`` `src/vlib/trace.c line 468 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L468>`_

Implementation: ``cli_add_trace_buffer``


trace filter
-------------------------------------------------------------------------

.. code-block:: console

    trace filter none | [include|exclude] NODE COUNT


Declaration: ``filter_trace_cli`` `src/vlib/trace.c line 570 <https://github.com/FDio/vpp/blob/master//src/vlib/trace.c#L570>`_

Implementation: ``cli_filter_trace``


trace frame-queue
-------------------------------------------------------------------------

.. code-block:: console

    trace frame-queue (on|off)


Declaration: ``cmd_trace_frame_queue`` `src/vlib/threads_cli.c line 182 <https://github.com/FDio/vpp/blob/master//src/vlib/threads_cli.c#L182>`_

Implementation: ``trace_frame_queue``