You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-39Lines changed: 20 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,17 @@ ePass could work with the verifier to improve its flexibility (i.e. reduce false
8
8
## Key Features
9
9
10
10
- **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.
13
13
14
14
> 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.
15
15
16
16
## Design Goals
17
17
18
-
- Flexible passes, allowing diverse use cases
18
+
- Flexible passes for diverse use cases
19
19
- Working with existing verifier instead of replacing its
20
20
- Keeping kernel safety
21
+
- Support both userspace and kernel
21
22
22
23
## Prerequisites
23
24
@@ -27,60 +28,40 @@ ePass could work with the verifier to improve its flexibility (i.e. reduce false
27
28
28
29
## Project Components
29
30
30
-
- `ePass core`: the core compiler framework
31
+
- `ePass core`: the core compiler framework, including a userspace CLI
31
32
- `ePass kernel`: Linux kernel 6.5 with ePass core built-in, along with the kernel component and kernel passes
32
33
- `ePass libbpf`: libbpf with ePass support for userspace ePass testing
33
-
- `ePass bpftool`: support for ePass
34
34
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`.
40
36
41
-
```bash
42
-
make configure # Do it once
37
+
### ePass Overview
43
38
44
-
make build
45
-
```
39
+

46
40
47
-
### Install
41
+
### ePass Core
48
42
49
-
```bash
50
-
make install
51
-
```
43
+

52
44
53
-
### Basic Usage
54
-
55
-
```bash
56
-
# Run ePass on the program
57
-
epass read prog.o
45
+
## Quick Start
58
46
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).
61
48
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).
65
50
66
-
## Development
51
+
We recommend users trying ePass in userspace before switching to the ePass kernel version!
67
52
68
-
### Generate Additional Assets
53
+
## Testing
69
54
70
-
```bash
71
-
# Generate kernel objects
72
-
make kernel
55
+
See [Testing](./docs/TESTING.md).
73
56
74
-
# Build ePass object files for libbpf
75
-
make buildobj
76
-
```
57
+
## Development and Contribution
77
58
59
+
See [Development](./docs/CONTRIBUTION_GUIDE.md).
78
60
79
61
## Contact and citation
80
62
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>.
82
64
83
65
## Acknowledgement
84
66
85
-
ePass is sponsoredby OrderLab from University of Michigan.
86
-
67
+
ePass is sponsored by [OrderLab](https://orderlab.io/) from University of Michigan.
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`:
0 commit comments