summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--memps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/memps.c b/memps.c
index d8e81f4..2504cd8 100644
--- a/memps.c
+++ b/memps.c
@@ -41,6 +41,7 @@
#define STR_DRM_PATH1 "/drm mm object (deleted)"
#define STR_DRM_PATH2 "/dev/dri/card"
#define STR_DRM_DBG_DIR "/sys/kernel/debug/dri/"
+#define STR_DRM_RENDER_PATH "/dev/dri/renderD"
#define MEMCG_PATH "/sys/fs/cgroup/memory"
#define ZRAM_USED_PATH "/sys/block/zram0/mem_used_total"
#define ZRAM_MM_STAT_PATH "/sys/block/zram0/mm_stat"
@@ -107,6 +108,7 @@ struct trib_mapinfo {
unsigned peak_rss;
unsigned other_devices;
unsigned gem_mmap;
+ unsigned render_gem_mmap;
};
struct geminfo {
@@ -820,6 +822,7 @@ static void init_trib_mapinfo(trib_mapinfo *tmi)
tmi->peak_rss = 0;
tmi->other_devices = 0;
tmi->gem_mmap = 0;
+ tmi->render_gem_mmap = 0;
}
unsigned int get_graphic_3d_meminfo(unsigned int tgid)
@@ -881,6 +884,9 @@ get_trib_mapinfo(unsigned int tgid, mapinfo *milist,
!strncmp(mi->name, STR_DRM_PATH2,
sizeof(STR_DRM_PATH2))) {
result->gem_mmap += mi->rss;
+ } else if (!strncmp(mi->name, STR_DRM_RENDER_PATH,
+ sizeof(STR_DRM_RENDER_PATH))) {
+ result->render_gem_mmap += mi->rss;
} else {
result->shared_clean += mi->shared_clean;
result->shared_dirty += mi->shared_dirty;
@@ -910,6 +916,8 @@ get_trib_mapinfo(unsigned int tgid, mapinfo *milist,
result->peak_rss = result->rss;
if (result->gem_mmap > 0)
result->peak_rss -= result->gem_mmap;
+ if (result->render_gem_mmap > 0)
+ result->peak_rss -= result->render_gem_mmap;
gi = find_geminfo(tgid, gilist);
if (gi != NULL) {