diff --git a/MagicEyes/src/backend/memory/mem_watcher/bpf/procstat.bpf.c b/MagicEyes/src/backend/memory/mem_watcher/bpf/procstat.bpf.c index 6d44f33ac..13d08e593 100644 --- a/MagicEyes/src/backend/memory/mem_watcher/bpf/procstat.bpf.c +++ b/MagicEyes/src/backend/memory/mem_watcher/bpf/procstat.bpf.c @@ -33,7 +33,7 @@ pid_t user_pid = 0; SEC("kprobe/finish_task_switch") int BPF_KPROBE(finish_task_switch, struct task_struct *prev) { struct procstat_event *e; - struct mm_rss_stat rss = {}; + struct percpu_counter rss = {}; struct mm_struct *mms; long long *t; pid_t pid = bpf_get_current_pid_tgid() >> 32; @@ -65,7 +65,7 @@ int BPF_KPROBE(finish_task_switch, struct task_struct *prev) { e->nvcsw = BPF_CORE_READ(prev, nvcsw); e->nivcsw = BPF_CORE_READ(prev, nivcsw); - rss = BPF_CORE_READ(prev, mm, rss_stat); + rss = *BPF_CORE_READ(prev, mm, rss_stat); t = (long long *)(rss.count); e->rssfile = *t; e->rssanon = *(t + 1);