This project implements a fast tracepoint insertion ecosystem for x86(_64) on Linux.
To build the library, you must install the following.
Libraries
- boost 1.66+
- Capstone
- Google Protocol Buffers for C++ and Python 3
- Google Benchmark
- LTTng (optional)
Programs
- Python 3.6+
- Cmake 3+
- C++17 capable compiler and libraries
mkdir build
cd build
cmake ..
make
sudo make install
After this, you must create the dyntrace group.
sudo groupadd dyntrace
sudo usermod -aG dyntrace <your username>
First, start the dyntraced daemon.
sudo dyntraced --daemonize
Then attach to any program. If your user is not in the dyntrace group, you won't be allowed to do this command.
dyntrace attach <pid or name>
Then add a tracepoint. It will log to the file /tmp/test.log.
dyntrace add <pid or name>:<function name or address> log /tmp/test.log
There will be an output on the command line, this is the name of the tracepoint with the form tp-#
Wait a bit, then remove the tracepoint.
dyntrace rm <pid or name>:tp-#
Full example:
sudo dyntraced --daemonize
dyntrace attach nano
dyntrace add nano:do_home lttng
...
dyntrace rm nano:tp-0
sudo pkill dyntraced
More details in the docs folder.
To trace x86 programs, you need the x86 build on x64.- ARM 64bit
Christian Harper-Cyr [email protected]