diff options
author | Mark Wielaard <mjw@redhat.com> | 2010-03-01 12:42:59 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2010-03-03 12:43:31 +0100 |
commit | 8822ed7f38927e45168f2ee5375ee844de3d1900 (patch) | |
tree | 6216116e533c7a037bcf51fce7bbe55434731c53 /tapset | |
parent | b36411e750e154eede9019e97844731927141a9e (diff) | |
download | systemtap-steved-8822ed7f38927e45168f2ee5375ee844de3d1900.tar.gz systemtap-steved-8822ed7f38927e45168f2ee5375ee844de3d1900.tar.xz systemtap-steved-8822ed7f38927e45168f2ee5375ee844de3d1900.zip |
Add documentation and tests for proc_mem_*_pid functions.
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/proc_mem.stp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tapset/proc_mem.stp b/tapset/proc_mem.stp index 3de8cc00..25a9b8ad 100644 --- a/tapset/proc_mem.stp +++ b/tapset/proc_mem.stp @@ -66,6 +66,13 @@ function proc_mem_size:long () THIS->__retvalue = 0; %} +/** + * sfunction proc_mem_size_pid - Total program virtual memory size in pages. + * + * Description: Returns the total virtual memory size in pages of the + * given process, or zero when that process doesn't exist or the + * number of pages couldn't be retrieved. + */ function proc_mem_size_pid:long (pid:long) { task = pid2task(pid); @@ -95,6 +102,13 @@ function proc_mem_rss:long () THIS->__retvalue = 0; %} +/** + * sfunction proc_mem_rss_pid - Program resident set size in pages. + * + * Description: Returns the resident set size in pages of the given + * process, or zero when the process doesn't exist or the number of + * pages couldn't be retrieved. + */ function proc_mem_rss_pid:long (pid:long) { task = pid2task(pid); @@ -124,6 +138,13 @@ function proc_mem_shr:long () THIS->__retvalue = 0; %} +/** + * sfunction proc_mem_shr_pid - Program shared pages (from shared mappings). + * + * Description: Returns the shared pages (from shared mappings) of the + * given process, or zero when the process doesn't exist or the + * number of pages couldn't be retrieved. + */ function proc_mem_shr_pid:long (pid:long) { task = pid2task(pid); @@ -161,6 +182,13 @@ function _stp_mem_txt_adjust:long (start_code:long, end_code:long) - (start_code & PAGE_MASK)) >> PAGE_SHIFT; %} +/** + * sfunction proc_mem_txt_pid - Program text (code) size in pages. + * + * Description: Returns the given process text (code) size in pages, + * or zero when the process doesn't exist or the number of pages + * couldn't be retrieved. + */ function proc_mem_txt_pid:long (pid:long) { task = pid2task(pid); @@ -193,6 +221,13 @@ function proc_mem_data:long () THIS->__retvalue = 0; %} +/** + * sfunction proc_mem_data_pid - Program data size (data + stack) in pages. + * + * Description: Returns the given process data size (data + stack) + * in pages, or zero when the process doesn't exist or the number of + * pages couldn't be retrieved. + */ function proc_mem_data_pid:long (pid:long) { task = pid2task(pid); @@ -290,6 +325,13 @@ function proc_mem_string:string () pages_to_string(proc_mem_data())); } +/** + * sfunction proc_mem_string_pid - Human readable string of process memory usage. + * + * Description: Returns a human readable string showing the size, rss, + * shr, txt and data of the memory used by the given process. + * For example "size: 301m, rss: 11m, shr: 8m, txt: 52k, data: 2248k". + */ function proc_mem_string_pid:string (pid:long) { return sprintf ("size: %s, rss: %s, shr: %s, txt: %s, data: %s", |