lmkd: fallback to reading procfs stats when failing to read cgroup stats am: dcd968db5e

Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/3454703

Change-Id: Ie11f16434a6192cceb2bbafd82a22931c29e93b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Suren Baghdasaryan 2025-01-15 15:39:05 -08:00 committed by Automerger Merge Worker
commit 810b69632d
1 changed files with 5 additions and 6 deletions

View File

@ -158,13 +158,12 @@ struct memory_stat *stats_read_memory_stat(bool per_app_memcg, int pid, uid_t ui
if (memory_stat_from_cgroup(&mem_st, pid, uid) == 0) {
return &mem_st;
}
} else {
}
if (memory_stat_from_procfs(&mem_st, pid) == 0) {
mem_st.rss_in_bytes = rss_bytes;
mem_st.swap_in_bytes = swap_bytes;
return &mem_st;
}
}
return NULL;
}