-
Notifications
You must be signed in to change notification settings - Fork 474
Home
uftrace is a tool to trace and analyze execution of a program written in C/C++. It was inspired by Linux kernel's ftrace (especially function graph tracer), and supports userspace programs on Linux. In order to use uftrace, the program should be compiled with -pg
or -finstrument-functions
option. (On ARM platforms, you may need to add -fno-omit-frame-pointer
option also). The example output looks like below:
$ cat hello.c
#include <stdio.h>
int main(void)
{
return printf("%s world\n", "Hello");
}
$ gcc -pg -o hello hello.c
$ uftrace ./hello
Hello world
# DURATION TID FUNCTION
[ 7516] | main() {
414.023 us [ 7516] | printf();
697.310 us [ 7516] | } /* main */
In the above example, uftrace ran the hello program (it printed "Hello world") and showed the execution replay with duration and tid. As you can see, the uftrace replay output resembles the original source code. In addition, uftrace provides useful commands and features to analyze behavior of your program.
The uftrace depends on libelf from elfutils (plus a couple of optional libraries). On debian-based systems, you can install uftrace and the required packages with below command:
$ sudo apt-get install build-essential git libelf-dev
$ git clone https://github.com/namhyung/uftrace.git
$ cd uftrace
$ make
$ sudo make install
For more information, please refer INSTALL.md page.
TODO
- uftrace - uftrace overview
- uftrace record - run and save result
- uftrace replay - show execution flow
- uftrace report - analyze execution result
- uftrace live - run and show execution flow
- uftrace info - show process metadata
- uftrace dump - show and convert raw result
- uftrace recv - save result through network
- uftrace graph - show function call graph
- Home
- Tutorial
- Development
- Practical Use Cases
- GCC
- Clang/LLVM
- Node.js
- Chromium
- MySQL/InnoDB
- FFmpeg
- CPython
- POCO
- Telegram
- yara
- RustPython
- cURL
- bpftrace
- SpiderMonkey
- Apache HTTP Server
- GStreamer
- Squid
- TCPDUMP
- OpenCV
- Libav
- Wireshark
- LXC
- Git
- Radare2
- uftrace on Android
- deno
- parallel sort algorithm
- LevelDB/RocksDB (YCSB)
- Redis
- libjpeg‐turbo (JPEG)
- JM (H.264/AVC)
- HM (HEVC)
- VTM (VVC)
- CUDA
- Erlang/OTP BEAM
- uftrace on Yocto
- TTCN3