diff --git a/source/tools/monitor/unity/collector/plugin/Makefile b/source/tools/monitor/unity/collector/plugin/Makefile index 63b7aaf79b1c07b5a2492d9e48c91dc2e6fd9dc1..4f4007be71f6c84c9ef32d40c5448ea9f930709b 100644 --- a/source/tools/monitor/unity/collector/plugin/Makefile +++ b/source/tools/monitor/unity/collector/plugin/Makefile @@ -4,7 +4,7 @@ LDFLAG := -g -fpic -shared OBJS := proto_sender.o LIB := libproto_sender.a -DEPMOD=sample threads kmsg proc_schedstat proc_loadavg unity_nosched unity_irqoff cpudist cpu_bled net_health net_retrans netlink cpufreq gpuinfo pmu_events virtout sum_retrans virtiostat +DEPMOD=sample threads kmsg proc_schedstat proc_loadavg unity_nosched unity_irqoff cpudist cpu_bled net_health net_retrans netlink cpufreq gpuinfo pmu_events virtout sum_retrans virtiostat podmem all: $(LIB) $(DEPMOD) diff --git a/source/tools/monitor/unity/collector/plugin/podmem/memcg.cpp b/source/tools/monitor/unity/collector/plugin/podmem/memcg.cpp index bea1c24f824cb52f2730e2828efd4c70e4ee94d2..e740cffe2e3b1f3af171824dde053fb8169bafda 100644 --- a/source/tools/monitor/unity/collector/plugin/podmem/memcg.cpp +++ b/source/tools/monitor/unity/collector/plugin/podmem/memcg.cpp @@ -133,7 +133,7 @@ static int get_filename(unsigned long dentry, char *filename, int len) return 0; } -int get_top_dentry(unsigned long pfn, int top) +int get_top_dentry(unsigned long pfn, int top, unsigned long cinode) { unsigned long page = PFN_TO_PAGE(pfn); map::iterator iter2; @@ -171,7 +171,7 @@ int get_top_dentry(unsigned long pfn, int top) return 0; cachedset.insert(pair(inode,cached*4)); - history_inodes[inode] = 1; + history_inodes[inode] = cinode; if (cachedset.size() > top) cachedset.erase(--cachedset.end()); } @@ -286,6 +286,7 @@ static int get_dentry_top() info->dirty = 0; info->inactive = 0; info->del = del; + info->cindoe = history_inodes[inode]; info->size = i_size>>10; strncpy(info->filename, end, sizeof(info->filename) - 2); @@ -557,7 +558,7 @@ int scan_pageflags_nooutput(struct options *opt, char *res) shmem = !!(pageflag & (1 <top); + get_top_dentry(pfn, opt->top, inode); } } get_dentry_top();