Skip to content

Commit 9afc86b

Browse files
authored
CI: add build benchmark and License identifier (#87)
* add license * add build benchmark ci * add more license identifier * add more license * add license * add more license header * fix redis patch * ci: fix compile * fix ci
1 parent 391c174 commit 9afc86b

File tree

116 files changed

+847
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+847
-216
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build benchmarks
2+
3+
on:
4+
push:
5+
branches: "master"
6+
pull_request:
7+
branches: "master"
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: 'recursive'
17+
18+
- name: install deps
19+
run: |
20+
sudo apt install -y --no-install-recommends \
21+
libelf1 libelf-dev zlib1g-dev make git libboost1.74-all-dev \
22+
binutils-dev libyaml-cpp-dev gcc-12 g++-12 llvm
23+
24+
- name: build runtime
25+
run: CC=gcc-12 CXX=g++-12 make release -j
26+
27+
- name: build benchmarks
28+
run: make -C benchmark

.github/workflows/test-runtime.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929

3030
- name: build runtime with mpk enable
3131
run: |
32-
make clean
33-
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=0 \
34-
-DCMAKE_BUILD_TYPE:STRING=Release \
35-
-DBPFTIME_ENABLE_LTO=0 -DBPFTIME_ENABLE_MPK=1
36-
cmake --build build --config Release
32+
make clean
33+
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBPFTIME_ENABLE_MPK=1
34+
cmake --build build --config Debug -DBPFTIME_ENABLE_MPK=1
35+
cmake --build build
36+
3737
- name: test runtime with mpk
38-
run: make unit-test
38+
run: make unit-test

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ see [documents/build-and-test.md](https://github.com/eunomia-bpf/bpftime/tree/ma
189189
- [ ] More examples and usecases:
190190
- [ ] Network on userspace eBPF
191191
- [ ] Hotpatch userspace application
192+
- [ ] Error injection and filter syscall
192193
- [ ] etc...
193194
- [ ] More map types and distribution maps support.
194195
- [ ] More program types support.

benchmark/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
all: benchmark test
12
test: test.c
23
gcc test.c -o test
4+
5+
# test with the files in bpf-loader
6+
TEST_CASES_DIRS=$(filter-out $(SKIP_TESTS),$(shell ls -l $(./) | grep ^d | awk '{print $$9}'))
7+
benchmark: $(TEST_CASES_DIRS)
8+
9+
.PHONY:$(TEST_CASES_DIRS)
10+
# build the test cases
11+
$(TEST_CASES_DIRS):
12+
make -C $(TEST_EXAMPLE_DIR)$@/

benchmark/bpf-syscall/bpf-syscall-bench.c

-115
This file was deleted.

benchmark/ssl-nginx/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
access.log
22
nginx.pid
33
nginx-error.txt
4-
sslsniff
4+
sslsniff
5+
wrk

benchmark/ssl-nginx/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
index.html: index.html

benchmark/tools/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
readlink

benchmark/tools/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
readlink: readlink.cpp
2+
g++ readlink.cpp -o readlink

daemon/bpf_tracer_event.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
26
#ifndef __SYSCALL_TRACER_H
37
#define __SYSCALL_TRACER_H
48

daemon/kernel/bpf_defs.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_BPF_DEFS_H
27
#define BPFTIME_BPF_DEFS_H
38

daemon/kernel/bpf_event_ringbuf.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPF_UTILS_H
27
#define BPF_UTILS_H
38

daemon/kernel/bpf_kernel_config.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_KERNEL_CONFIG_H
27
#define BPFTIME_KERNEL_CONFIG_H
38

daemon/kernel/bpf_obj_id_fd_map.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_BPF_MAPS_ID_FD_MAP
27
#define BPFTIME_BPF_MAPS_ID_FD_MAP
38

daemon/kernel/bpf_pid_fd_map.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_BPF_PID_FD_MAP
27
#define BPFTIME_BPF_PID_FD_MAP
38

daemon/kernel/bpf_tracer.bpf.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// SPDX-License-Identifier: GPL-2.0
2-
// Copyright (c) 2019 Facebook
3-
// Copyright (c) 2020 Netflix
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
46
#include <vmlinux.h>
57
#include <bpf/bpf_helpers.h>
68
#include <bpf/bpf_tracing.h>

daemon/test/common_def.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef _COMMON_DEF_HPP
27
#define _COMMON_DEF_HPP
38
#include <string>

daemon/test/test_daemon.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#include <catch2/catch_test_macros.hpp>
27
#include <cstdint>
38
#include <attach/attach_manager/frida_attach_manager.hpp>

daemon/test/test_daemon_driver.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#include <catch2/catch_test_macros.hpp>
27
#include <cstdint>
38
#include <attach/attach_manager/frida_attach_manager.hpp>

daemon/user/bpf_tracer.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// Description: bpf_tracer daemon
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
26
#include "spdlog/common.h"
37
#include <argp.h>
48
#include <signal.h>

daemon/user/bpftime_driver.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#include "bpftime_driver.hpp"
27
#include <linux/bpf.h>
38
#include <bpf/bpf.h>

daemon/user/bpftime_driver.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_DRIVER_HPP
27
#define BPFTIME_DRIVER_HPP
38

daemon/user/daemon.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_DAEMON_HPP
27
#define BPFTIME_DAEMON_HPP
38

daemon/user/daemon_config.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_DAEMON_CONFIG_HPP
27
#define BPFTIME_DAEMON_CONFIG_HPP
38

daemon/user/handle_bpf_event.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#include <bpf/libbpf.h>
27
#include <bpf/bpf.h>
38
#include <linux/bpf.h>

daemon/user/handle_bpf_event.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
16
#ifndef BPFTIME_HANDLE_EVENT_HPP
27
#define BPFTIME_HANDLE_EVENT_HPP
38

daemon/user/main.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2022, eunomia-bpf org
4+
* All rights reserved.
5+
*/
26
#include <argp.h>
37
#include <cstdint>
48
#include <cstdlib>

benchmark/bpf-syscall/.gitignore example/hot_patch/redis/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package.json
55
*.skel.yaml
66
package.yaml
77
ecli
8+
redis-patch
89
.output
910
test
10-
uretprobe
11-
bpf-syscall-bench
11+
victim

0 commit comments

Comments
 (0)