]> The Tcpdump Group git mirrors - tcpdump/commit
autoconf: Add an option to help debugging (--enable-instrument-functions)
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 10 Jan 2022 15:37:07 +0000 (16:37 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 21 Oct 2023 18:47:42 +0000 (20:47 +0200)
commit37ae1bef66f103426fcad091faf5d9ad0744a304
tree19948e588521576d828604c0098cd59714911c2f
parent9a3a64a3bced3e5dbafaab25ffe78dc9439a7b30
autoconf: Add an option to help debugging (--enable-instrument-functions)

Generate instrumentation calls for entry and exit to functions.
Just after function entry and just before function exit, these
profiling functions are called and print the function names with
indentation and call level.

If entering in a function, print also the calling function name with
file name and line number. There may be a small shift in the line number.

In some cases, with Clang 11, the file number is unknown (printed '??')
or the line number is unknown (printed '?'). In this case, use GCC.

Usage:
$ ./configure --enable-instrument-functions
$ make -s clean all

If the environment variable INSTRUMENT is
- unset or set to an empty string, print nothing, like with no
  instrumentation
- set to "all" or "a", print all the functions names
- set to "global" or "g", print only the global functions names

This allows to run:
$ INSTRUMENT=a ./tcpdump ...
$ INSTRUMENT=g ./tcpdump ...
$ INSTRUMENT= ./tcpdump ...
or
$ export INSTRUMENT=global
$ ./tcpdump ...

The library libbfd is used, therefore the binutils-dev package is required.

(backported from main)

[skip ci]
CONTRIBUTING.md
Makefile.in
config.h.in
configure
configure.ac
instrument-functions.c [new file with mode: 0644]
print.c