Skip to content

Instantly share code, notes, and snippets.

@agentzh
Created January 3, 2020 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentzh/08df635987f70a8eca21df360a46ad84 to your computer and use it in GitHub Desktop.
Save agentzh/08df635987f70a8eca21df360a46ad84 to your computer and use it in GitHub Desktop.
diff --git a/tapset/linux/proc_mem.stp b/tapset/linux/proc_mem.stp
index 2b152f6ae..a9048c322 100644
--- a/tapset/linux/proc_mem.stp
+++ b/tapset/linux/proc_mem.stp
@@ -71,6 +71,11 @@ enum {
return @const("MM_ANONPAGES")
}
+@__private30 function _MM_SHMEMPAGES:long()
+{
+ return @const("MM_SHMEMPAGES")
+}
+
@__private30 function _stp_get_mm_counter:long(mm_ptr:long, member:long)
{
mm = & @mm(mm_ptr)
@@ -167,7 +172,9 @@ function proc_mem_rss:long ()
mm = @task(task)->mm
if (mm != 0)
return (_stp_get_mm_counter(mm, _MM_FILEPAGES())
- + _stp_get_mm_counter(mm, _MM_ANONPAGES()))
+ + _stp_get_mm_counter(mm, _MM_ANONPAGES())
+ + _stp_get_mm_counter(mm, _MM_SHMEMPAGES())
+ )
}
return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment