Skip to content

Commit

Permalink
Merge pull request #25 from chriskaliX/v1.0.0
Browse files Browse the repository at this point in the history
#issue1 Fix
  • Loading branch information
chriskaliX authored Mar 24, 2022
2 parents b6cc76f + bc77f6c commit 8b9d673
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions plugin/driver/eBPF/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ all:
$(MAKE) hades_ebpf_driver.o -s --no-print-directory
$(shell cp hades_ebpf_driver.o ../userspace/hades_ebpf_driver.o)

# KBUILD_NAME: https://github.com/iovisor/bpftrace/pull/1352
hades_ebpf_driver.o: src/hades.c
$(CMD_CLANG) src/hades.c -S \
-D__BPF_TRACING__ \
-D__KERNEL__ \
-D__TARGET_ARCH_$(linux_arch) \
-DKBUILD_MODNAME=\"hades\" \
-include $(KERN_SRC_PATH)/include/linux/kconfig.h \
-I $(KERN_SRC_PATH)/arch/$(linux_arch)/include \
-I $(KERN_SRC_PATH)/arch/$(linux_arch)/include/uapi \
Expand Down
11 changes: 10 additions & 1 deletion plugin/driver/eBPF/kernel/include/hades_uprobe.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,13 @@ int uretprobe_bash_readline(struct pt_regs *ctx)
// And uprobe (maybe, I have not checked yet) can be used in kernel version
// lower 4.18, above 3.18 (maybe). The way we used in k(ret)probe/uprobe,
// the pt_regs, seems to be used in kernel > 4.17. We need to change the
// format.
// format.
// SEC("uprobe/JVM_GC")
// int uprobe_JVM_GC(struct pt_regs *ctx)
// {
// event_data_t data = {};
// if (!init_event_data(&data, ctx))
// return 0;
// data.context.type = 2001;
// return events_perf_submit(&data);
// }
1 change: 0 additions & 1 deletion plugin/driver/eBPF/kernel/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <linux/fdtable.h>
#include <utils_buf.h>
#include <linux/mm_types.h>
#define KBUILD_MODNAME "hades"
#include <net/ipv6.h>
#include <linux/ipv6.h>

Expand Down
4 changes: 4 additions & 0 deletions plugin/driver/eBPF/userspace/decoder/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type Event interface {
var eventMap map[uint32]Event = make(map[uint32]Event)

func Regist(event Event) {
// if event.ID() != 2001 {
// return
// }
// fmt.Println(event.String(), " loaded!")
eventMap[event.ID()] = event
}

Expand Down

0 comments on commit 8b9d673

Please sign in to comment.