SkillAgentSearch skills...

Dyntrace

Dynamic tracing in Linux using fast tracepoints

Install / Use

/learn @charpercyr/Dyntrace
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

dyntrace

This project implements a fast tracepoint insertion ecosystem for x86(_64) on Linux.

Getting Started

Prerequesites

To build the library, you must install the following.

Libraries

Programs

Building & Installing

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>

Simple usage

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.

<aside class="notice"> To trace x86 programs, you need the x86 build on x64. </aside>

TODO

  • ARM 64bit

Contact

Christian Harper-Cyr charpercyr@gmail.com

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated1y ago
Forks2

Languages

C++

Security Score

80/100

Audited on May 5, 2024

No findings