ugwis / ebpf-http-parser Goto Github PK
View Code? Open in Web Editor NEWParse HTTP(S) requests by eBPF hooks without APM
License: Apache License 2.0
Parse HTTP(S) requests by eBPF hooks without APM
License: Apache License 2.0
When I finished configuring the environment I found some errors as follows
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master# make
go generate
/root/桌面/ebpf-http-parser-master/kprobe.c:3:10: fatal error: 'bpf_tracing.h' file not found
#include <bpf_tracing.h>
^~~~~~~~~~~~~~~
1 error generated.
Error: clang-9: exit status 1
exit status 1
main.go:30: running "go": exit status 1
make: *** [Makefile:8:main] 错误 1
So I tried to find the header file, and I put the header file of the bpftool folder in it, and then I found that something else was missing
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master# find / -name bpf_tracing.h
/var/lib/docker/overlay2/b8fc50d0d4e7f9f6d337b245c7a0d6819441c6ec04b8987707bf94cf5b356ba0/diff/usr/include/bpf/bpf_tracing.h
/root/桌面/bcc/src/cc/libbpf/src/bpf_tracing.h
/root/桌面/bcc/libbpf-tools/bpftool/libbpf/src/bpf_tracing.h
/root/桌面/bpftool/libbpf/src/bpf_tracing.h
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master# make
go generate
/root/桌面/ebpf-http-parser-master/kprobe.c:4:10: fatal error: 'common.h' file not found
#include "common.h"
^~~~~~~~~~
1 error generated.
Error: clang-9: exit status 1
exit status 1
main.go:30: running "go": exit status 1
make: *** [Makefile:8:main] 错误 1
I put /usr/src/linux-hwe-5.13-headers-5.13.0-52/arch/x86/include/asm/trace/common.h and found other unsolvable problems
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master# find / -name common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/arch/mips/include/asm/netlogic/common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/arch/x86/include/asm/trace/common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/arch/arm/plat-orion/include/plat/common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/arch/arm/mach-davinci/include/mach/common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/include/dt-bindings/leds/common.h
/usr/src/linux-hwe-5.13-headers-5.13.0-52/include/soc/tegra/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/arch/mips/include/asm/netlogic/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/arch/x86/include/asm/trace/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/arch/arm/plat-orion/include/plat/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/arch/arm/mach-davinci/include/mach/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/include/dt-bindings/leds/common.h
/usr/src/linux-hwe-5.15-headers-5.15.0-43/include/soc/tegra/common.h
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master# make
go generate
In file included from /root/桌面/ebpf-http-parser-master/kprobe.c:4:
/root/桌面/ebpf-http-parser-master/common.h:9:15: error: unknown type name 'bool'
static inline bool trace_pagefault_enabled(void) { return false; }
^
/root/桌面/ebpf-http-parser-master/common.h:9:59: error: use of undeclared identifier 'false'; did you mean 'else'?
static inline bool trace_pagefault_enabled(void) { return false; }
^~~~~
else
/root/桌面/ebpf-http-parser-master/common.h:9:59: error: expected expression
/root/桌面/ebpf-http-parser-master/kprobe.c:14:17: error: expected ';' after top level declarator
char __license[] SEC("license") = "Dual MIT/GPL";
^
;
/root/桌面/ebpf-http-parser-master/kprobe.c:21:24: error: expected parameter declarator
struct bpf_map_def SEC("maps/connectlist") connectlist = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:21:24: error: expected ')'
/root/桌面/ebpf-http-parser-master/kprobe.c:21:23: note: to match this '('
struct bpf_map_def SEC("maps/connectlist") connectlist = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:21:44: error: expected function body after function declarator
struct bpf_map_def SEC("maps/connectlist") connectlist = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:32:24: error: expected parameter declarator
struct bpf_map_def SEC("maps/probe_cache") probe_cache = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:32:24: error: expected ')'
/root/桌面/ebpf-http-parser-master/kprobe.c:32:23: note: to match this '('
struct bpf_map_def SEC("maps/probe_cache") probe_cache = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:32:44: error: expected function body after function declarator
struct bpf_map_def SEC("maps/probe_cache") probe_cache = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:39:24: error: expected parameter declarator
struct bpf_map_def SEC("maps/dataevent") dataevent = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:39:24: error: expected ')'
/root/桌面/ebpf-http-parser-master/kprobe.c:39:23: note: to match this '('
struct bpf_map_def SEC("maps/dataevent") dataevent = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:39:42: error: expected function body after function declarator
struct bpf_map_def SEC("maps/dataevent") dataevent = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:46:2: error: unknown type name 'u8'
u8 type;
^
/root/桌面/ebpf-http-parser-master/kprobe.c:47:2: error: unknown type name 'u32'
u32 sock_fd;
^
/root/桌面/ebpf-http-parser-master/kprobe.c:48:2: error: unknown type name 'u8'
u8 buf[1024];
^
/root/桌面/ebpf-http-parser-master/kprobe.c:51:24: error: expected parameter declarator
struct bpf_map_def SEC("maps/messagelist") messagelist = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:51:24: error: expected ')'
/root/桌面/ebpf-http-parser-master/kprobe.c:51:23: note: to match this '('
struct bpf_map_def SEC("maps/messagelist") messagelist = {
^
/root/桌面/ebpf-http-parser-master/kprobe.c:51:44: error: expected function body after function declarator
struct bpf_map_def SEC("maps/messagelist") messagelist = {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Error: clang-9: exit status 1
exit status 1
main.go:30: running "go": exit status 1
make: *** [Makefile:8:main] 错误 1
root@zy-virtual-machine:~/桌面/ebpf-http-parser-master#
Now I don't know what to do
please help me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.