Skip to content

Commit

Permalink
Merge branch 'linuxkerneltravel:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
13186379707 authored Mar 7, 2024
2 parents 3b74e0f + b03c9ae commit 92f77ea
Show file tree
Hide file tree
Showing 79 changed files with 5,178 additions and 4,056 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/eBPF_proc_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ jobs:
sudo insmod mutex_test1.ko
sudo insmod mutex_test2.ko
- name: Run test_sleep
run: |
cd eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/test
gcc test_sleep.c -o test_sleep
./test_sleep
- name: Run test_proc
run: |
cd eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ebpf_stack_analyser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
run: |
git submodule update --init --recursive
sudo apt install clang libelf1 libelf-dev zlib1g-dev
sudo cp eBPF_Supermarket/Stack_Analyser/FlameGraph/* /usr/bin/
- name: Run app with native lib
run: |
Expand Down Expand Up @@ -56,6 +55,7 @@ jobs:
python -m pip install --upgrade pip
sudo python -m pip install pyod
sudo python -m pip install psutil
sudo apt update
sudo apt-get install -y linux-headers-$(uname -r)
sudo apt-get install -y python-is-python3
sudo apt-get install -y bison build-essential cmake flex git libedit-dev libllvm11 llvm-11-dev libclang-11-dev zlib1g-dev libelf-dev libfl-dev python3-distutils
Expand Down
25 changes: 1 addition & 24 deletions .github/workflows/kvm_watcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt install clang libelf1 libelf-dev zlib1g-dev
sudo apt install libbpf-dev
sudo apt install linux-tools-$(uname -r)
sudo apt install linux-cloud-tools-$(uname -r)
sudo apt-get update && sudo apt-get install -y qemu-kvm
- name: Download Cirros image
run: |
wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
- name: Load KVM module
run: |
sudo modprobe kvm && sudo modprobe kvm-intel
- name: Run QEMU to start VM
run: |
sudo qemu-system-x86_64 -enable-kvm -cpu host -m 2048 -drive file=cirros-0.5.1-x86_64-disk.img,format=qcow2 -boot c -nographic &
- name: Run kvm_watcher
- name: Test program execution
run: |
cd eBPF_Supermarket/kvm_watcher/
make
sudo ./kvm_watcher -w -t 10
sudo ./kvm_watcher -e -t 10 -s
sudo ./kvm_watcher -n -t 10
sudo ./kvm_watcher -d -t 10
sudo ./kvm_watcher -f -m -t 10
sudo ./kvm_watcher -i -t 10
make clean
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ tags
*.iml

nohup.out

# Virtual machine image file
eBPF_Supermarket/kvm_watcher/*.img

eBPF_Supermarket/kvm_watcher/**/*.o
eBPF_Supermarket/kvm_watcher/**/*.skel.h
eBPF_Supermarket/kvm_watcher/**/vmlinux.h
eBPF_Supermarket/kvm_watcher/kvm_watcher
eBPF_Supermarket/kvm_watcher/**/temp*

# eBPF_proc_image
eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/.output/*
eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/proc_image
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
[submodule "eBPF_Supermarket/Stack_Analyser/libbpf/libbpf-bootstrap"]
path = eBPF_Supermarket/Stack_Analyser/libbpf/libbpf-bootstrap
url = https://github.com/libbpf/libbpf-bootstrap.git
[submodule "eBPF_Supermarket/Stack_Analyser/speedscope"]
path = eBPF_Supermarket/Stack_Analyser/speedscope
url = https://github.com/jlfwong/speedscope
[submodule "eBPF_Supermarket/Memory_Subsystem/blazesym"]
path = eBPF_Supermarket/Memory_Subsystem/blazesym
url = https://github.com/libbpf/blazesym.git
Expand Down
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
/eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image @helight @LinkinPF @chenamy2017 @zhangzihengya
/eBPF_Supermarket/Stack_Analyser @helight @LinkinPF @chenamy2017 @GorilaMond
/eBPF_Supermarket/kvm_watcher @helight @LinkinPF @chenamy2017 @nanshuaibo
/eBPF_Supermarket/Stack_Analyser @helight @LinkinPF @chenamy2017 @nanshuaibo
/eBPF_Supermarket/Memory_Subsystem @helight @LinkinPF @chenamy2017
25 changes: 10 additions & 15 deletions eBPF_Supermarket/CPU_Subsystem/cpu_watcher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ INCLUDES := -I$(OUTPUT) -I../../../libbpf/include/uapi -I$(dir $(VMLINUX)) -I$(L
CFLAGS := -g -Wall
ALL_LDFLAGS := $(LDFLAGS) $(EXTRA_LDFLAGS)

APPS =cs_delay sar cpu_watcher

APPS =cs_delay sar sc_delay
TARGETS=cpu_watcher


# Get Clang's default includes on this system. We'll explicitly add these dirs
Expand Down Expand Up @@ -79,12 +79,12 @@ $(call allow-override,CC,$(CROSS_COMPILE)cc)
$(call allow-override,LD,$(CROSS_COMPILE)ld)

.PHONY: all
all: $(APPS)
all: $(TARGETS)

.PHONY: clean
clean:
$(call msg,CLEAN)
$(Q)rm -rf $(OUTPUT) $(APPS)
$(Q)rm -rf $(OUTPUT) $(TARGETS)

$(OUTPUT) $(OUTPUT)/libbpf $(BPFTOOL_OUTPUT):
$(call msg,MKDIR,$@)
Expand Down Expand Up @@ -120,28 +120,23 @@ $(OUTPUT)/%.bpf.o: %.bpf.c $(LIBBPF_OBJ) $(wildcard %.h) $(VMLINUX) | $(OUTPUT)
$(Q)$(BPFTOOL) gen object $@ $(patsubst %.bpf.o,%.tmp.bpf.o,$@)

# Generate BPF skeletons
$(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(OUTPUT) $(BPFTOOL)
.PHONY: $(APPS)
$(APPS): %: $(OUTPUT)/%.bpf.o | $(OUTPUT) $(BPFTOOL)
$(call msg,GEN-SKEL,$@)
$(Q)$(BPFTOOL) gen skeleton $< > $@
$(Q)$(BPFTOOL) gen skeleton $< > $(OUTPUT)/$@.skel.h

# Build user-space code
$(patsubst %,$(OUTPUT)/%.o,$(APPS)): %.o: %.skel.h

$(OUTPUT)/%.o: %.c $(wildcard %.h) | $(OUTPUT)
$(OUTPUT)/$(TARGETS).o: $(TARGETS).c $(APPS) | $(OUTPUT)
$(call msg,CC,$@)
$(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@

$(patsubst %,$(OUTPUT)/%.o,$(BZS_APPS)): $(LIBBLAZESYM_OBJ)

$(BZS_APPS): $(LIBBLAZESYM_OBJ)

# Build application binary
$(APPS): %: $(OUTPUT)/%.o $(COMMON_OBJ) $(LIBBPF_OBJ) | $(OUTPUT)
$(TARGETS): %: $(OUTPUT)/%.o $(COMMON_OBJ) $(LIBBPF_OBJ) | $(OUTPUT)
$(call msg,BINARY,$@)
$(Q)$(CC) $(CFLAGS) $^ $(ALL_LDFLAGS) -lelf -lz -o $@

# delete failed targets
.DELETE_ON_ERROR:

# keep intermediate (.skel.h, .bpf.o, etc) targets
.SECONDARY:
.SECONDARY:
Loading

0 comments on commit 92f77ea

Please sign in to comment.