summaryrefslogtreecommitdiffstats
path: root/src/vlib/trace_funcs.h
AgeCommit message (Expand)AuthorFilesLines
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion1-3/+3
2021-02-27vlib: fix clear trace buffer race conditionBenoît Ganne1-4/+15
2020-12-15classify: add pcap/trace classfier mgmt API callsJon Loeliger1-1/+1
2020-11-09vlib: fix trace number accountingBenoît Ganne1-6/+14
2020-11-04vlib: add postmortem pcap dispatch traceDave Barach1-4/+2
2020-08-06misc: harmonize namesDave Barach1-5/+5
2020-06-08vlib: stop inlining vlib_add_trace(...)Dave Barach1-2/+8
2019-12-05classify: vpp packet tracer supportDave Barach1-0/+16
2019-07-30vlib: Fix packet tracingNeale Ranns1-1/+1
2019-07-26dhcp: send unicast and broadcast packets via the IP adjacencyNeale Ranns1-1/+1
2019-06-24vlib: packet tracer support for pkt thread handoffsDave Barach1-11/+15
2019-05-03Add callbacks for extended trace functionality, one as content is added with ...Gary Boon1-1/+12
2018-08-24Clean up packet tracer, especially "clear trace"Dave Barach1-0/+13
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+185
ckground-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
.. _sanitizer:

*****************
Google Sanitizers
*****************

VPP is instrumented to support `Google Sanitizers <https://github.com/google/sanitizers>`_.
As of today, only `AddressSanitizer <https://github.com/google/sanitizers/wiki/AddressSanitizer>`_
is supported and only for the heap.

AddressSanitizer
================

`AddressSanitizer <https://github.com/google/sanitizers/wiki/AddressSanitizer>`_  (aka ASan) is a memory
error detector for C/C++. Think Valgrind but much faster.

In order to use it, VPP must be recompiled with ASan support. It is implemented as a cmake
build option, so all VPP targets should be supported. For example:

.. code-block:: console

    # build a debug image with ASan support:
    $ make rebuild VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
    ....

    # build a release image with ASan support:
    $ make rebuild-release VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
    ....

    # build packages in debug mode with ASan support:
    $ make pkg-deb-debug VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
    ....

    # run GBP plugin tests in debug mode with ASan
    $ make test-debug TEST=test_gbp VPP_EXTRA_CMAKE_ARGS=-DENABLE_SANITIZE_ADDR=ON
    ....

Once VPP has been built with ASan support you can use it as usual including
under gdb:
.. code-block:: console

    $ gdb --args $PWD/build-root/install-vpp_debug-native/vpp/bin/vpp "unix { interactive }"
    ....