From 1751f872b6cfef79963bb29e58106a9878c35907 Mon Sep 17 00:00:00 2001 From: zhilan Date: Mon, 24 Apr 2023 19:01:15 +0800 Subject: [PATCH 1/2] oomcheck: Add case of large pagetables usage --- source/tools/detect/mem/oomcheck/oomcheck.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/tools/detect/mem/oomcheck/oomcheck.py b/source/tools/detect/mem/oomcheck/oomcheck.py index 83d75984..d3537b46 100644 --- a/source/tools/detect/mem/oomcheck/oomcheck.py +++ b/source/tools/detect/mem/oomcheck/oomcheck.py @@ -415,6 +415,10 @@ def oom_is_memleak(oom, oom_result): res["tcp_task"] = tcp["top_task"] res["tcp_mem"] = tcp["tcp_mem"] summary = "allocpage memleak, usage:%dkb\n"%(used) + if memleak_check(total, meminfo['pagetables']): + res['leaktype'] = 'pagetables' + res['leakusage'] = meminfo['pagetables'] + summary += "pagetables usage:%dkb indicates lots of processes or lots of mmaps\n"%(meminfo['pagetables']) if len(summary) != 0 and len(tcp) != 0: summary += "tcp_task:%s tcp_mem:%sKB\n"%(tcp["top_task"][0], tcp["tcp_mem"]) if len(summary) != 0: -- Gitee From 40e6e84b34a2b20b1359b14620389cb3518416d0 Mon Sep 17 00:00:00 2001 From: zhilan Date: Wed, 26 Apr 2023 19:02:44 +0800 Subject: [PATCH 2/2] podmem: fix bugs in offset --- source/tools/detect/mem/podmem/memcache/offset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/tools/detect/mem/podmem/memcache/offset.cpp b/source/tools/detect/mem/podmem/memcache/offset.cpp index cc70dad0..b4d36d88 100644 --- a/source/tools/detect/mem/podmem/memcache/offset.cpp +++ b/source/tools/detect/mem/podmem/memcache/offset.cpp @@ -128,7 +128,7 @@ static int download_btf(void) char arch[LEN] = {0}; char kernel[LEN] = {0}; char dw[LEN+LEN] = {0}; - string sysak_path = "/boot" + string sysak_path = "/boot"; string timeout = "-internal"; string cmd = "curl -s --connect-timeout 2 http://100.100.100.200/latest/meta-data/region-id 2>&1"; @@ -149,7 +149,7 @@ static int download_btf(void) if(getenv("SYSAK_WORK_PATH") != NULL) { sysak_path = getenv("SYSAK_WORK_PATH") ; - sysak_path += "/tools" + sysak_path += "/tools"; } snprintf(dw, LEN + LEN + LEN, "wget -T 5 -t 2 -q -O %s/%s/vmlinux-%s https://sysom-cn-%s.oss-cn-%s%s.aliyuncs.com/home/hive/btf/%s/vmlinux-%s",sysak_path.c_str(), kernel, kernel, ®ion[3],®ion[3],timeout.c_str(),arch, kernel); -- Gitee