Skip to content

Commit f2e92ae

Browse files
committed
docs: readme
1 parent d9eead0 commit f2e92ae

File tree

5 files changed

+94
-39
lines changed

5 files changed

+94
-39
lines changed

README.md

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ ePass could work with the verifier to improve its flexibility (i.e. reduce false
88
## Key Features
99

1010
- **IR-based compilation**: Converts BPF programs to an SSA-based intermediate representation for code rewriting
11-
- **Flexible passes**: ePass core provides various APIs to analyze and manipulate the IR, allowing users to write flexible passes including runtime checks and optimization.
12-
- **Command-line interface**: Easy-to-use CLI tool for testing in userspace
11+
- **Flexible passes**: ePass core provides various APIs to analyze and manipulate the IR, allowing users to write flexible passes including static analyzing, runtime checks, and optimization.
12+
- **User-friendly debugging**: ePass supports compiling to both kernel and userspace for easier debugging.
1313

1414
> ePass is under active development and we are improving its usability and safety. We welcome any suggestions and feedback. Feel free to open issues or contact us.
1515

1616
## Design Goals
1717

18-
- Flexible passes, allowing diverse use cases
18+
- Flexible passes for diverse use cases
1919
- Working with existing verifier instead of replacing its
2020
- Keeping kernel safety
21+
- Support both userspace and kernel
2122

2223
## Prerequisites
2324

@@ -27,60 +28,40 @@ ePass could work with the verifier to improve its flexibility (i.e. reduce false
2728

2829
## Project Components
2930

30-
- `ePass core`: the core compiler framework
31+
- `ePass core`: the core compiler framework, including a userspace CLI
3132
- `ePass kernel`: Linux kernel 6.5 with ePass core built-in, along with the kernel component and kernel passes
3233
- `ePass libbpf`: libbpf with ePass support for userspace ePass testing
33-
- `ePass bpftool`: support for ePass
3434

35-
## Quick Start
36-
37-
The main development happens in `core` directory. To start, `cd` into `core`.
38-
39-
### Build
35+
There are some testing projects including `bpftool`, `xdp-tools`, `falcolib` in `third-party`. They depend on `ePass libbpf`.
4036

41-
```bash
42-
make configure # Do it once
37+
### ePass Overview
4338

44-
make build
45-
```
39+
![Overview](./docs/overview.png)
4640

47-
### Install
41+
### ePass Core
4842

49-
```bash
50-
make install
51-
```
43+
![Core Architecture](./docs/core_design.png)
5244

53-
### Basic Usage
54-
55-
```bash
56-
# Run ePass on the program
57-
epass read prog.o
45+
## Quick Start
5846

59-
# Run ePass on the program with gopt and popt
60-
epass read --popt popts --gopt gopts prog.o
47+
There are two ways to use ePass. The first way is to build a linux kernel with ePass builtin, which is used for production. Users could specify ePass options when calling the `BPF` system call. See [Kernel Testing](docs/KERNEL_TESTING.md).
6148

62-
# Print the BPF program
63-
epass print prog.o
64-
```
49+
The second way is to build ePass in userspace and testing programs without changing the kernel, which is used mainly for testing. Users could specify ePass options via environment variable and use `ePass libbpf`. Programs will be modified in userspace before sending to the kernel. See [Userspace Testing](docs/USERSPACE_TESTING.md).
6550

66-
## Development
51+
We recommend users trying ePass in userspace before switching to the ePass kernel version!
6752

68-
### Generate Additional Assets
53+
## Testing
6954

70-
```bash
71-
# Generate kernel objects
72-
make kernel
55+
See [Testing](./docs/TESTING.md).
7356

74-
# Build ePass object files for libbpf
75-
make buildobj
76-
```
57+
## Development and Contribution
7758

59+
See [Development](./docs/CONTRIBUTION_GUIDE.md).
7860

7961
## Contact and citation
8062

81-
Feel free to open an issue for question, bug report or feature request! You could also email xiangyiming2002@gmail.com
63+
Feel free to open an issue for question, bug report or feature request! You could also email <xiangyiming2002@gmail.com>.
8264

8365
## Acknowledgement
8466

85-
ePass is sponsoredby OrderLab from University of Michigan.
86-
67+
ePass is sponsored by [OrderLab](https://orderlab.io/) from University of Michigan.

docs/EPASS_OPTIONS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Epass Options
2+
3+
## Global Options
4+
5+
6+
7+
## Pass Options

docs/KERNEL_TESTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Kernel Testing

docs/TESTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ePass Testing

docs/USERSPACE_TESTING.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Userspace Testing
2+
3+
The main development happens in `core` directory. To start, `cd` into `core`.
4+
5+
### Build
6+
7+
```bash
8+
make configure # Do it once
9+
10+
make build
11+
```
12+
13+
### Install
14+
15+
```bash
16+
make install
17+
```
18+
19+
### Basic Usage
20+
21+
```bash
22+
# Run ePass on the program
23+
epass read prog.o
24+
25+
# Run ePass on the program with gopt and popt
26+
epass read --popt popts --gopt gopts prog.o
27+
28+
# Print the BPF program
29+
epass print prog.o
30+
```
31+
32+
For `gopt` and `popt`, see [ePass Options](./EPASS_OPTIONS.md).
33+
34+
### Use ePass with `libbpf`
35+
36+
We may want to load a ePass-modified program to the kernel to see its effect. ePass provides a modified libbpf that allows users to run ePass before loading programs to the kernel. The advantage is that you do not need to change the kernel. However, running ePass in userspace cannot leverage the verifier, so it cannot use verifier information, cannot run verifier dependent passes, and cannot run kernel passes.
37+
38+
First, initializing all submodules.
39+
40+
```bash
41+
git submodule update --init --recursive
42+
```
43+
44+
Now open the `libbpf` source code directory and build:
45+
46+
```bash
47+
cd third-party/ePass-libbpf/src
48+
make -j
49+
```
50+
51+
To install `ePass libbpf`, install:
52+
53+
```bash
54+
sudo make install
55+
```
56+
57+
After installing ePass libbpf, you could run any programs that depends on the `libbpf` shared library with `ePass` commands.
58+
59+
For `bpftool`, you need to build `bpftool` because by default it statically link `libbpf`.
60+
61+
An example of using ePass to load `test.o` eBPF program using `bpftool`:
62+
63+
```bash
64+
sudo LIBBPF_ENABLE_EPASS=1 LIBBPF_EPASS_GOPT="verbose=3" LIBBPF_EPASS_POPT="msan" bpftool prog load test.o /sys/fs/bpf/test
65+
```

0 commit comments

Comments
 (0)