Skip to content

Commit

Permalink
CI: add build benchmark and License identifier (#87)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yunwei37 committed Nov 18, 2023
1 parent 391c174 commit 9afc86b
Show file tree
Hide file tree
Showing 116 changed files with 847 additions and 216 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build benchmarks

on:
push:
branches: "master"
pull_request:
branches: "master"

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: install deps
run: |
sudo apt install -y --no-install-recommends \
libelf1 libelf-dev zlib1g-dev make git libboost1.74-all-dev \
binutils-dev libyaml-cpp-dev gcc-12 g++-12 llvm
- name: build runtime
run: CC=gcc-12 CXX=g++-12 make release -j

- name: build benchmarks
run: make -C benchmark
12 changes: 6 additions & 6 deletions .github/workflows/test-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:

- name: build runtime with mpk enable
run: |
make clean
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=0 \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DBPFTIME_ENABLE_LTO=0 -DBPFTIME_ENABLE_MPK=1
cmake --build build --config Release
make clean
cmake -Bbuild -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBPFTIME_ENABLE_MPK=1
cmake --build build --config Debug -DBPFTIME_ENABLE_MPK=1
cmake --build build

- name: test runtime with mpk
run: make unit-test
run: make unit-test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ see [documents/build-and-test.md](https://github.com/eunomia-bpf/bpftime/tree/ma
- [ ] More examples and usecases:
- [ ] Network on userspace eBPF
- [ ] Hotpatch userspace application
- [ ] Error injection and filter syscall
- [ ] etc...
- [ ] More map types and distribution maps support.
- [ ] More program types support.
Expand Down
10 changes: 10 additions & 0 deletions benchmark/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
all: benchmark test
test: test.c
gcc test.c -o test

# test with the files in bpf-loader
TEST_CASES_DIRS=$(filter-out $(SKIP_TESTS),$(shell ls -l $(./) | grep ^d | awk '{print $$9}'))
benchmark: $(TEST_CASES_DIRS)

.PHONY:$(TEST_CASES_DIRS)
# build the test cases
$(TEST_CASES_DIRS):
make -C $(TEST_EXAMPLE_DIR)$@/
115 changes: 0 additions & 115 deletions benchmark/bpf-syscall/bpf-syscall-bench.c

This file was deleted.

3 changes: 2 additions & 1 deletion benchmark/ssl-nginx/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
access.log
nginx.pid
nginx-error.txt
sslsniff
sslsniff
wrk
1 change: 1 addition & 0 deletions benchmark/ssl-nginx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html: index.html
1 change: 1 addition & 0 deletions benchmark/tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
readlink
2 changes: 2 additions & 0 deletions benchmark/tools/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
readlink: readlink.cpp
g++ readlink.cpp -o readlink
6 changes: 5 additions & 1 deletion daemon/bpf_tracer_event.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef __SYSCALL_TRACER_H
#define __SYSCALL_TRACER_H

Expand Down
5 changes: 5 additions & 0 deletions daemon/kernel/bpf_defs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_BPF_DEFS_H
#define BPFTIME_BPF_DEFS_H

Expand Down
5 changes: 5 additions & 0 deletions daemon/kernel/bpf_event_ringbuf.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPF_UTILS_H
#define BPF_UTILS_H

Expand Down
5 changes: 5 additions & 0 deletions daemon/kernel/bpf_kernel_config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_KERNEL_CONFIG_H
#define BPFTIME_KERNEL_CONFIG_H

Expand Down
5 changes: 5 additions & 0 deletions daemon/kernel/bpf_obj_id_fd_map.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_BPF_MAPS_ID_FD_MAP
#define BPFTIME_BPF_MAPS_ID_FD_MAP

Expand Down
5 changes: 5 additions & 0 deletions daemon/kernel/bpf_pid_fd_map.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_BPF_PID_FD_MAP
#define BPFTIME_BPF_PID_FD_MAP

Expand Down
8 changes: 5 additions & 3 deletions daemon/kernel/bpf_tracer.bpf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2019 Facebook
// Copyright (c) 2020 Netflix
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include <vmlinux.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
Expand Down
5 changes: 5 additions & 0 deletions daemon/test/common_def.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef _COMMON_DEF_HPP
#define _COMMON_DEF_HPP
#include <string>
Expand Down
5 changes: 5 additions & 0 deletions daemon/test/test_daemon.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include <attach/attach_manager/frida_attach_manager.hpp>
Expand Down
5 changes: 5 additions & 0 deletions daemon/test/test_daemon_driver.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include <attach/attach_manager/frida_attach_manager.hpp>
Expand Down
6 changes: 5 additions & 1 deletion daemon/user/bpf_tracer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Description: bpf_tracer daemon
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include "spdlog/common.h"
#include <argp.h>
#include <signal.h>
Expand Down
5 changes: 5 additions & 0 deletions daemon/user/bpftime_driver.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include "bpftime_driver.hpp"
#include <linux/bpf.h>
#include <bpf/bpf.h>
Expand Down
5 changes: 5 additions & 0 deletions daemon/user/bpftime_driver.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_DRIVER_HPP
#define BPFTIME_DRIVER_HPP

Expand Down
5 changes: 5 additions & 0 deletions daemon/user/daemon.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_DAEMON_HPP
#define BPFTIME_DAEMON_HPP

Expand Down
5 changes: 5 additions & 0 deletions daemon/user/daemon_config.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_DAEMON_CONFIG_HPP
#define BPFTIME_DAEMON_CONFIG_HPP

Expand Down
5 changes: 5 additions & 0 deletions daemon/user/handle_bpf_event.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include <bpf/libbpf.h>
#include <bpf/bpf.h>
#include <linux/bpf.h>
Expand Down
5 changes: 5 additions & 0 deletions daemon/user/handle_bpf_event.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#ifndef BPFTIME_HANDLE_EVENT_HPP
#define BPFTIME_HANDLE_EVENT_HPP

Expand Down
6 changes: 5 additions & 1 deletion daemon/user/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
/* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022, eunomia-bpf org
* All rights reserved.
*/
#include <argp.h>
#include <cstdint>
#include <cstdlib>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package.json
*.skel.yaml
package.yaml
ecli
redis-patch
.output
test
uretprobe
bpf-syscall-bench
victim
Loading

0 comments on commit 9afc86b

Please sign in to comment.