]> git.proxmox.com Git - ceph.git/blame - ceph/src/tracing/README.md
update sources to v12.1.0
[ceph.git] / ceph / src / tracing / README.md
CommitLineData
7c673cae
FG
1Installation
2============
3
4The LTTng libraries that ship with Ubuntu 12.04 have been very buggy, and the
5generated header files using `lttng-gen-tp` have needed to be fixed just to
6compile in the Ceph tree. The packages available in Ubuntu 14.04 seem to work
7alright, and for older versions please install LTTng from the LTTng PPA.
8
9 https://launchpad.net/~lttng/+archive/ppa
10
11Then install as normal
12
13 apt-get install lttng-tools liblttng-ust-dev
14
15Add/Update Provider
16===================
17
18## Create tracepoint definition file
19
20Add tracepoint definitions for the provider into a `.tp` file. Documentation
21on defining a tracepoint can be found in `man lttng-ust`. By convention files
22are named according to the logical sub-system they correspond to (e.g.
23`mutex.tp`, `pg.tp`). And add a C source file to be compiled into the tracepoint
24provider shared object, in which `TRACEPOINT_DEFINE` should be defined. See
25[LTTng document](http://lttng.org/docs/#doc-dynamic-linking) for details.
26Place the `.tp` and the `.c` files into the `src/tracing` directory
27and modify the CMake file `src/tracing/CMakeLists.txt` accordingly.
28
31f18b77
FG
29Function Instrumentation
30========================
31Ceph supports instrumentation using GCC's `-finstrument-functions` flag.
32Supported CMake flags are:
33
34* `-DWITH_OSD_INSTRUMENT_FUNCTIONS=ON`: instrument OSD code
35
36Note that this instrumentation adds an extra function call on each function entry
37and exit of Ceph code. This option is currently only supported with GCC. Using it
38with Clang has no effect.
39
40The only function tracing implementation at the moment is done using LTTng UST.
41In order to use it, Ceph needs to be configured with LTTng using `-DWITH_LTTNG=ON`.
42[TraceCompass](http://www.tracecompass.org) can be used to generate flame
43charts/graphs and other metrics.
44
45It is also possible to use [libbabeltrace](http://diamon.org/babeltrace/#docs)
46to write custom analysis. The entry and exit tracepoints are called
47`lttng_ust_cyg_profile:func_enter` and `lttng_ust_cyg_profile:func_exit`
48respectively. The payload variable `addr` holds the address of the function
49called and the payload variable `call_site` holds the address where it is called.
50`nm` can be used to resolve function addresses (`addr` to function name).
7c673cae 51