about summary refs log tree commit diff
path: root/malloc/memusage.sh
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/memusage.sh')
-rwxr-xr-xmalloc/memusage.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 0c383268c6..877c17be4e 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -44,6 +44,7 @@ Profile memory usage of PROGRAM.
    -u,--unbuffered        Don't buffer output
    -b,--buffer=SIZE       Collect SIZE entries before writing them out
       --no-timer          Don't collect additional information though timer
+   -m,--mmap              Also trace mmap & friends
 
    -?,--help              Print this help and exit
       --usage             Give a short usage message
@@ -134,6 +135,9 @@ while test $# -gt 0; do
   --n | --no | --no- | --no-t | --no-ti | --no-tim | --no-time | --no-timer)
     notimer=yes
     ;;
+  -m | --m | --mm | --mma | --mmap)
+    tracemmap=yes
+    ;;
   -t | --tim | --time | --time- | --time-b | --time-ba | --time-bas | --time-base | --time-based)
     memusagestat_args="$memusagestat_args -t"
     ;;
@@ -234,6 +238,11 @@ if test -n "$notimer"; then
   add_env="$add_env MEMUSAGE_NO_TIMER=yes"
 fi
 
+# Trace mmap.
+if test -n "$tracemmap"; then
+  add_env="$add_env MEMUSAGE_TRACE_MMAP=yes"
+fi
+
 # Execute the program itself.
 eval $add_env '"$@"'
 result=$?