mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 10:42:23 +02:00
doc: Add initial USDT documentation
Both added files are extended in the following commits. doc/usdt.md is based on earlier work by laanwj. Co-authored-by: W. J. van der Laan <laanwj@protonmail.com>
This commit is contained in:
45
contrib/tracing/README.md
Normal file
45
contrib/tracing/README.md
Normal file
@ -0,0 +1,45 @@
|
||||
Example scripts for User-space, Statically Defined Tracing (USDT)
|
||||
=================================================================
|
||||
|
||||
This directory contains scripts showcasing User-space, Statically Defined
|
||||
Tracing (USDT) support for Bitcoin Core on Linux using. For more information on
|
||||
USDT support in Bitcoin Core see the [USDT documentation].
|
||||
|
||||
[USDT documentation]: ../../doc/tracing.md
|
||||
|
||||
|
||||
Examples for the two main eBPF front-ends, [bpftrace] and
|
||||
[BPF Compiler Collection (BCC)], with support for USDT, are listed. BCC is used
|
||||
for complex tools and daemons and `bpftrace` is preferred for one-liners and
|
||||
shorter scripts.
|
||||
|
||||
[bpftrace]: https://github.com/iovisor/bpftrace
|
||||
[BPF Compiler Collection (BCC)]: https://github.com/iovisor/bcc
|
||||
|
||||
|
||||
To develop and run bpftrace and BCC scripts you need to install the
|
||||
corresponding packages. See [installing bpftrace] and [installing BCC] for more
|
||||
information. For development there exist a [bpftrace Reference Guide], a
|
||||
[BCC Reference Guide], and a [bcc Python Developer Tutorial].
|
||||
|
||||
[installing bpftrace]: https://github.com/iovisor/bpftrace/blob/master/INSTALL.md
|
||||
[installing BCC]: https://github.com/iovisor/bcc/blob/master/INSTALL.md
|
||||
[bpftrace Reference Guide]: https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md
|
||||
[BCC Reference Guide]: https://github.com/iovisor/bcc/blob/master/docs/reference_guide.md
|
||||
[bcc Python Developer Tutorial]: https://github.com/iovisor/bcc/blob/master/docs/tutorial_bcc_python_developer.md
|
||||
|
||||
## Examples
|
||||
|
||||
The bpftrace examples contain a relative path to the `bitcoind` binary. By
|
||||
default, the scripts should be run from the repository-root and assume a
|
||||
self-compiled `bitcoind` binary. The paths in the examples can be changed, for
|
||||
example, to point to release builds if needed. See the
|
||||
[Bitcoin Core USDT documentation] on how to list available tracepoints in your
|
||||
`bitcoind` binary.
|
||||
|
||||
[Bitcoin Core USDT documentation]: ../../doc/tracing.md#listing-available-tracepoints
|
||||
|
||||
**WARNING: eBPF programs require root privileges to be loaded into a Linux
|
||||
kernel VM. This means the bpftrace and BCC examples must be executed with root
|
||||
privileges. Make sure to carefully review any scripts that you run with root
|
||||
privileges first!**
|
Reference in New Issue
Block a user