Commit 5097e4de authored by Alastair Robertson's avatar Alastair Robertson

Update README

parent 54afd828
# BPFtrace # BPFtrace
BPFtrace is currently a work in progress and can not currently run scripts. The examples below are to give an idea of what the final result should be. BPFtrace aims to be a [DTrace](http://dtrace.org)-style dynamic tracing tool for linux, based on the extended BPF capabilities available in recent Linux kernels. BPFtrace uses [LLVM](http://llvm.org) to compile scripts to BPF-bytecode and many helper functions are included from [BCC](https://github.com/iovisor/bcc).
BPFtrace's scripting language is inspired by [ply](https://github.com/iovisor/ply) and DTrace.
## Examples ## Examples
BPFtrace is a work in progress and can not currently run scripts. The examples below are to give an idea of what the final result should be.
To produce a histogram of amount of time spent in the `read()` system call: To produce a histogram of amount of time spent in the `read()` system call:
``` ```
kprobe:sys_read kprobe:sys_read
...@@ -19,6 +23,8 @@ kretprobe:sys_read / @start[tid] / ...@@ -19,6 +23,8 @@ kretprobe:sys_read / @start[tid] /
``` ```
## Builtins ## Builtins
The list of available builtins will grow as more features are added.
The following builtin variables are available for use in BPFtrace scripts: The following builtin variables are available for use in BPFtrace scripts:
- `pid` - Process ID - `pid` - Process ID
- `tid` - Thread ID - `tid` - Thread ID
...@@ -40,7 +46,7 @@ The following builtin functions are also available: ...@@ -40,7 +46,7 @@ The following builtin functions are also available:
## Compilation ## Compilation
Compile using CMake, optionally substituting "Release" for "Debug" as CMAKE\_BUILD\_TYPE: Compile using CMake, optionally substituting "Release" for "Debug" as CMAKE\_BUILD\_TYPE:
``` ```
git clone https://github.com/ajor/bpftrace.git git clone https://github.com/ajor/bpftrace
cd bpftrace cd bpftrace
mkdir build mkdir build
cd build cd build
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment