Skip to content

Commit

Permalink
Merge pull request #923 from Super-Lzzx/develop
Browse files Browse the repository at this point in the history
  MagicEyes[mem_watcher]:修改适配的代码
  • Loading branch information
chenamy2017 authored Oct 11, 2024
2 parents f0afb06 + e4e0ad7 commit 03de9a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MagicEyes/src/backend/memory/mem_watcher/bpf/procstat.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 03de9a5

Please sign in to comment.