Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add embedded clang/llvm for runtime compilation of eBPF programs #6978

Merged
merged 78 commits into from
Jan 21, 2021
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f04485c
Add basic clang 11 compiler
brycekahle Oct 23, 2020
ec0c56f
Fix compiler to match local build
brycekahle Nov 11, 2020
d5d21d9
Add quotes around KBUILD_MODNAME
brycekahle Nov 11, 2020
a8e1257
Whitespace fixes to compiler C++
brycekahle Nov 18, 2020
6002415
Working bundled and non-bundled tests pass
brycekahle Nov 18, 2020
afa5afb
Embedded stdarg.h with compiler
brycekahle Nov 19, 2020
45d1ee9
Working network tracer with runtime compiler
brycekahle Dec 4, 2020
2d9d2b6
Add config value for runtime compiler output directory
brycekahle Nov 23, 2020
70de38e
Rename runtime compiler enable setting
brycekahle Nov 23, 2020
78ce2cf
Add env var for setting kernel header dirs
brycekahle Nov 23, 2020
104ae07
Add preprocessor that replaces #include statements with header contents
brycekahle Nov 24, 2020
e1e88f2
Fix default BPFDir value to be absolute
brycekahle Nov 24, 2020
83b48fb
Make sure to close non-bundled files that are opened
brycekahle Nov 24, 2020
21bb603
Add basic content integrity hash generator
brycekahle Nov 24, 2020
2959477
Extract compilation logic into runtime asset
brycekahle Nov 25, 2020
f8bfa41
Add runtime-compilation of runtime-security probe
brycekahle Nov 25, 2020
c6d722d
Improve output of go generate tools
brycekahle Nov 25, 2020
dce38d3
Improve TestEbpfBytesCorrect
brycekahle Dec 4, 2020
e24d382
Fix import cycle
brycekahle Nov 25, 2020
989dc5b
Include content integrity generated files to prevent build problems
brycekahle Nov 30, 2020
a76847d
Update security probe C path
brycekahle Dec 4, 2020
8113565
Add stub for runtime-compiled security probe on unsupported builds
brycekahle Dec 4, 2020
ab34c9c
Improve default config BPFDir logic
brycekahle Dec 7, 2020
5d0d146
Move dst_port to prevent unused variable warning
brycekahle Dec 7, 2020
a4e5122
security-agent doesn't need linux_bpf tag
brycekahle Dec 8, 2020
924884a
Use updated sysprobe build images
brycekahle Dec 8, 2020
4c47b61
Fix compiler build on arm64
brycekahle Dec 8, 2020
380461d
We don't need terminfo for our use of clang/llvm
brycekahle Dec 9, 2020
4c47633
Add clang build output tarball to artifacts so we can download it
brycekahle Dec 9, 2020
0a81a72
Use $CI_PROJECT_DIR/.tmp as temp dir
brycekahle Dec 9, 2020
bf827d7
static link libstdc++
brycekahle Dec 9, 2020
b806a3b
wrap select libm (math.h) functions to target older glibc
brycekahle Dec 10, 2020
6320366
Move build flags to common function
brycekahle Dec 10, 2020
800da0d
Install specific version of kernel-headers on CentOS
brycekahle Dec 10, 2020
41c4d1a
Fix network tracer build on old kernels
brycekahle Dec 10, 2020
a42c445
Fix kernel-devel install on older centos versions
brycekahle Dec 11, 2020
aaecea0
Switch to centos 7.6 for system-probe testing
brycekahle Dec 11, 2020
b1867e3
Update buildimage
brycekahle Dec 11, 2020
b645029
Extract common functions into headers to be shared between prebuilt/r…
brycekahle Dec 11, 2020
a26549a
Remove unused variable in system_probe.py script
brycekahle Dec 11, 2020
c7c7e6b
Limit compiler stub for security to just linux
brycekahle Dec 14, 2020
d15b833
Add argument validation to compiler c++
brycekahle Dec 14, 2020
607dafa
Fix CGO_LDFLAGS_ALLOW to not clobber on win32
brycekahle Dec 14, 2020
1bdee9e
Add missing check for socat in test setup script
brycekahle Dec 14, 2020
9d4d381
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Dec 14, 2020
f4713e8
improve compiler c++ further
brycekahle Dec 14, 2020
1d2c0bd
Make LLVM init thread-safe using std::call_once
brycekahle Dec 14, 2020
6cf8e73
Add comment clarifying behavior of include_headers
brycekahle Dec 14, 2020
d8dd972
Remove remapped_files into ClangCompiler
brycekahle Dec 15, 2020
99326b4
Use std::make_unique where possible
brycekahle Dec 15, 2020
ccba0b6
Remove more C-style casts
brycekahle Dec 15, 2020
dc73d4a
Fix compiler output to flow through diagnostics engine
brycekahle Dec 15, 2020
c57c903
Move default cflags to package-level variable
brycekahle Dec 15, 2020
6292876
Add comment about curDir function
brycekahle Dec 15, 2020
e863580
No need for cast in compiler delete
brycekahle Dec 15, 2020
508d733
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Dec 15, 2020
bbdd4e6
Close compiler when done with it
brycekahle Dec 15, 2020
3403fa1
Fix defaultflag usage
brycekahle Dec 15, 2020
cec32e9
use llvm::IntrusiveRefCntPtr for diagnosticsEngine to prevent segfault
brycekahle Dec 15, 2020
505a4c3
Add release note for runtime compilation
brycekahle Dec 16, 2020
7347b87
Prevent config warning on startup if kernel_header_dirs not set
brycekahle Dec 17, 2020
a029c5f
Add missing config.SetKnown calls
brycekahle Dec 18, 2020
3a559e2
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Jan 4, 2021
5621deb
Fix comment typo
brycekahle Jan 4, 2021
0cfd109
Update runtime asset hashes
brycekahle Jan 4, 2021
e5d48a6
Change to use in-memory buffer for compiler input
brycekahle Jan 4, 2021
e90cd3b
Fix potential deadlock in http monitor
brycekahle Jan 5, 2021
62295ee
Allow compiler to compile files OR buffers
brycekahle Jan 5, 2021
e721c25
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Jan 6, 2021
7fe6084
Include hash of cflags in output filename
brycekahle Jan 7, 2021
4e83d96
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Jan 7, 2021
5709e34
Merge branch 'master' into bryce.kahle/runtime-compilation
brycekahle Jan 8, 2021
13339b9
Merge remote-tracking branch 'origin/master' into bryce.kahle/runtime…
brycekahle Jan 20, 2021
1640dac
Update runtime assets
brycekahle Jan 20, 2021
57fdc94
Run kitchen tests another time using the runtime compiled probes
brycekahle Jan 20, 2021
a9d0730
Merge remote-tracking branch 'origin/master' into bryce.kahle/runtime…
brycekahle Jan 20, 2021
b3f8dfb
Passthrough wait_thr to check_output
brycekahle Jan 20, 2021
4cbf304
Make it clear which version of tests are running
brycekahle Jan 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix potential deadlock in http monitor
  • Loading branch information
brycekahle committed Jan 5, 2021
commit e90cd3bfaa43dae3c5356904e3f0086199a8d521
6 changes: 5 additions & 1 deletion pkg/network/http/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ func (m *Monitor) Start() error {
}

m.process(nil, errLostBatch)
case reply := <-m.pollRequests:
case reply, ok := <-m.pollRequests:
if !ok {
return
}

transactions := m.batchManager.GetPendingTransactions()
m.process(transactions, nil)
reply <- struct{}{}
Expand Down