From a70020a4c7393d6f41a2f7e4c943bccead2b5bea Mon Sep 17 00:00:00 2001 From: fengzx33 Date: Tue, 8 Aug 2023 19:17:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=A4=E5=A4=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=EF=BC=9A1.build=E8=A7=84=E5=88=99=E4=B8=ADec?= =?UTF-8?q?ho=E5=90=8E=E9=9D=A2=E7=9A=84\=E5=88=A0=E9=99=A4=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E7=9C=9F=E6=AD=A3build=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E6=89=A7=E8=A1=8C=202.=E5=88=A0=E9=99=A4all?= =?UTF-8?q?=E8=A7=84=E5=88=99=EF=BC=8C=E5=8E=9F=E5=9B=A0build=20goenv?= =?UTF-8?q?=E5=BA=94=E9=A1=BA=E5=BA=8F=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/tools/monitor/raptor/source/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/tools/monitor/raptor/source/Makefile b/source/tools/monitor/raptor/source/Makefile index d1a729f8..1ae072a8 100644 --- a/source/tools/monitor/raptor/source/Makefile +++ b/source/tools/monitor/raptor/source/Makefile @@ -14,8 +14,6 @@ EXTRA_CGO_CFLAGS := -I$(abspath ./ebpf/src/libbpf/lib/include) \ EXTRA_CGO_LDFLAGS := -L$(abspath ./ebpf/src/libbpf/lib/lib64) -lbpf \ -L$(abspath ./ebpf/src/bcc/lib/lib) -lbcc-syms -lstdc++ -lelf -lz \ -L$(abspath ./ebpf/src/lib) -lnginx -.PHONY: all -all: build goenv .PHONY: goenv goenv: @@ -24,7 +22,7 @@ goenv: .PHONY: build build: - @echo "Complie Golong Code..." \ + @echo "Complie Golong Code..." CGO_CFLAGS="$(EXTRA_CGO_CFLAGS)" \ CGO_LDFLAGS="$(EXTRA_CGO_LDFLAGS)" \ go build -ldflags "-linkmode external -extldflags '-static' -X 'main.version=$(RELEASE_VERSION)' \ -- Gitee From ec28c378f797d8d8b2cc9ee2a387509fcec7b9c4 Mon Sep 17 00:00:00 2001 From: fengzx33 Date: Wed, 9 Aug 2023 15:45:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3cgtool=E4=B8=ADcgtool=5Fc?= =?UTF-8?q?ommon.h=E5=92=8Ccgtoollib=5Fbpf.h=E4=B8=8Evmlinux.h=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=AE=9A=E4=B9=89=E8=8B=A5=E5=B9=B2=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/tools/detect/cgroup/cgtool_comm.h | 133 --------------------- source/tools/detect/cgroup/cgtoollib_bpf.h | 1 - 2 files changed, 134 deletions(-) diff --git a/source/tools/detect/cgroup/cgtool_comm.h b/source/tools/detect/cgroup/cgtool_comm.h index 07af7325..9bae7bbe 100644 --- a/source/tools/detect/cgroup/cgtool_comm.h +++ b/source/tools/detect/cgroup/cgtool_comm.h @@ -74,61 +74,6 @@ struct mm_struct___MEMCG { long unsigned int cpu_bitmap[0]; }; -struct page_counter { - atomic_long_t usage; - long unsigned int min; - long unsigned int low; - long unsigned int max; - struct page_counter *parent; - long unsigned int emin; - atomic_long_t min_usage; - atomic_long_t children_min_usage; - long unsigned int elow; - atomic_long_t low_usage; - atomic_long_t children_low_usage; - long unsigned int wmark_low; - long unsigned int wmark_high; - long unsigned int watermark; - long unsigned int failcnt; -}; - -struct vmpressure { - long unsigned int scanned; - long unsigned int reclaimed; - long unsigned int tree_scanned; - long unsigned int tree_reclaimed; - struct spinlock sr_lock; - struct list_head events; - struct mutex events_lock; - struct work_struct work; -}; - -struct mem_cgroup_thresholds { - struct mem_cgroup_threshold_ary *primary; - struct mem_cgroup_threshold_ary *spare; -}; - -struct memcg_padding { - char x[0]; -}; - -enum memcg_kmem_state { - KMEM_NONE = 0, - KMEM_ALLOCATED = 1, - KMEM_ONLINE = 2, -}; - -struct mem_cgroup_id { - int id; - atomic_t ref; -}; - -struct deferred_split { - spinlock_t split_queue_lock; - struct list_head split_queue; - long unsigned int split_queue_len; -}; - union kernfs_node_id { struct { u32 ino; @@ -137,84 +82,6 @@ union kernfs_node_id { u64 id; }; -struct mem_cgroup { - struct cgroup_subsys_state css; - struct mem_cgroup_id id; - struct page_counter memory; - struct page_counter swap; - struct page_counter memsw; - struct page_counter kmem; - struct page_counter tcpmem; - long unsigned int high; - struct work_struct high_work; - long unsigned int soft_limit; - struct vmpressure vmpressure; - bool use_hierarchy; - bool oom_group; - bool oom_lock; - int under_oom; - int swappiness; - int oom_kill_disable; - struct cgroup_file events_file; - struct cgroup_file swap_events_file; - struct mutex thresholds_lock; - struct mem_cgroup_thresholds thresholds; - struct mem_cgroup_thresholds memsw_thresholds; - struct list_head oom_notify; - long unsigned int move_charge_at_immigrate; - spinlock_t move_lock; - long unsigned int move_lock_flags; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct memcg_padding _pad1_; - atomic_t moving_account; - struct task_struct *move_lock_task; - struct mem_cgroup_stat_cpu *stat_cpu; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct memcg_padding _pad2_; - atomic_long_t stat[35]; - atomic_long_t events[84]; - atomic_long_t memory_events[7]; - long unsigned int socket_pressure; - bool tcpmem_active; - int tcpmem_pressure; - unsigned int wmark_ratio; - struct work_struct wmark_work; - unsigned int wmark_scale_factor; - int kmemcg_id; - enum memcg_kmem_state kmem_state; - struct list_head kmem_caches; - int last_scanned_node; - nodemask_t scan_nodes; - atomic_t numainfo_events; - atomic_t numainfo_updating; - struct list_head cgwb_list; - struct wb_domain cgwb_domain; - struct list_head event_list; - spinlock_t event_list_lock; - struct deferred_split deferred_split_queue; - long unsigned int ali_reserved1; - long unsigned int ali_reserved2; - long unsigned int ali_reserved3; - long unsigned int ali_reserved4; - struct mem_cgroup_per_node *nodeinfo[0]; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; - struct cgroup___MEMCG { struct cgroup_subsys_state self; long unsigned int flags; diff --git a/source/tools/detect/cgroup/cgtoollib_bpf.h b/source/tools/detect/cgroup/cgtoollib_bpf.h index 80e553b1..f802fef7 100644 --- a/source/tools/detect/cgroup/cgtoollib_bpf.h +++ b/source/tools/detect/cgroup/cgtoollib_bpf.h @@ -10,7 +10,6 @@ #include "cgtool_comm.h" #define BPF_ANY 0 -#define NULL ((void*)0) static u64 get_knid_by_cgroup(struct cgroup___MEMCG *cgrp) { -- Gitee