README.md
1
2## Fedora Demo VM
3
4Before running the script, ensure that virt-install is available on the system.
5
6`./build_bpf_demo.sh -n bpf-demo -k bpf_demo.ks.erb`
7
8After setting up the initial VM, log in (the default password is 'iovisor')
9and determine the DHCP IP. SSH to this IP as root.
10
11To set up a kernel with the right options, run `bpf-kernel-setup`.
12
13```
14[root@bpf-demo ~]# bpf-kernel-setup
15Cloning into 'net-next'...
16```
17After pulling the net-next branch, the kernel config menu should pop up. Ensure
18that the below settings are proper.
19```
20General setup --->
21 [*] Enable bpf() system call
22Networking support --->
23 Networking options --->
24 QoS and/or fair queueing --->
25 <M> BPF-based classifier
26 <M> BPF based action
27 [*] enable BPF Just In Time compiler
28```
29Once the .config is saved, the build will proceed and install the resulting
30kernel. This kernel has updated userspace headers (e.g. the bpf() syscall) which
31install into /usr/local/include...proper packaging for this will be
32distro-dependent.
33
34Next, run `bpf-llvm-setup` to pull and compile LLVM with BPF support enabled.
35```
36[root@bpf-demo ~]# bpf-llvm-setup
37Cloning into 'llvm'...
38```
39The resulting libraries will be installed into /opt/local/llvm.
40
41Next, reboot into the new kernel, either manually or by using the kexec helper.
42```
43[root@bpf-demo ~]# kexec-4.1.0-rc1+
44Connection to 192.168.122.247 closed by remote host.
45Connection to 192.168.122.247 closed.
46```
47
48Reconnect and run the final step, building and testing bcc.
49```
50[root@bpf-demo ~]# bcc-setup
51Cloning into 'bcc'...
52...
53Linking CXX shared library libcc.so
54[100%] Built target bcc
55...
56Running tests...
57Test project /root/bcc/build
58 Start 1: py_test1
591/4 Test #1: py_test1 ......................... Passed 0.24 sec
60 Start 2: py_test2
612/4 Test #2: py_test2 ......................... Passed 0.53 sec
62 Start 3: py_trace1
633/4 Test #3: py_trace1 ........................ Passed 0.09 sec
64 Start 4: py_trace2
654/4 Test #4: py_trace2 ........................ Passed 1.06 sec
66
67100% tests passed, 0 tests failed out of 4
68```
69