summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-20 04:46:22 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-20 04:46:22 +0000
commitba80a015ee80c01be5100b8b94794b8784aa562b (patch)
tree7bb6db1e6fa726246c08346ce0732e393f174450 /malloc
parentea97f90c9a84ce5c8a7c60695f05adfd2b6bb295 (diff)
Update.
* malloc/Makefile: Change all references to memprof into memusage. * malloc/memprof.c: Rename to... * malloc/memusage.c: ...this. New file. * malloc/memprof.sh: Rename to... * malloc/memusage.sh: ...this. New file. * malloc/memprofstat.c: Rename to... * malloc/memusagestat.c: ...this. New file.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/memusage.c (renamed from malloc/memprof.c)22
-rwxr-xr-xmalloc/memusage.sh (renamed from malloc/memprof.sh)54
-rw-r--r--malloc/memusagestat.c (renamed from malloc/memprofstat.c)4
3 files changed, 40 insertions, 40 deletions
diff --git a/malloc/memprof.c b/malloc/memusage.c
index 56d3ac556e..6296d99230 100644
--- a/malloc/memprof.c
+++ b/malloc/memusage.c
@@ -1,5 +1,5 @@
/* Profile heap and stack memory usage of running program.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -28,7 +28,7 @@
#include <unistd.h>
#include <sys/time.h>
-#include <memprof.h>
+#include <memusage.h>
/* Pointer to the real functions. These are determined used `dlsym'
when really needed. */
@@ -164,24 +164,24 @@ init (void)
/* Find out whether this is the program we are supposed to profile.
For this the name in the variable `__progname' must match the one
- given in the environment variable MEMPROF_PROG_NAME. If the variable
+ given in the environment variable MEMUSAGE_PROG_NAME. If the variable
is not present every program assumes it should be profiling.
If this is the program open a file descriptor to the output file.
We will write to it whenever the buffer overflows. The name of the
- output file is determined by the environment variable MEMPROF_OUTPUT.
+ output file is determined by the environment variable MEMUSAGE_OUTPUT.
- If the environment variable MEMPROF_BUFFER_SIZE is set its numerical
+ If the environment variable MEMUSAGE_BUFFER_SIZE is set its numerical
value determines the size of the internal buffer. The number gives
the number of elements in the buffer. By setting the number to one
one effectively selects unbuffered operation.
- If MEMPROF_NO_TIMER is not present an alarm handler is installed
+ If MEMUSAGE_NO_TIMER is not present an alarm handler is installed
which at the highest possible frequency records the stack pointer. */
static void
me (void)
{
- const char *env = getenv ("MEMPROF_PROG_NAME");
+ const char *env = getenv ("MEMUSAGE_PROG_NAME");
size_t prog_len = strlen (__progname);
if (env != NULL)
{
@@ -195,7 +195,7 @@ me (void)
/* Only open the file if it's really us. */
if (!not_me && fd == -1)
{
- const char *outname = getenv ("MEMPROF_OUTPUT");
+ const char *outname = getenv ("MEMUSAGE_OUTPUT");
if (outname != NULL)
{
fd = creat (outname, 0666);
@@ -216,15 +216,15 @@ me (void)
/* Determine the buffer size. We use the default if the
environment variable is not present. */
buffer_size = DEFAULT_BUFFER_SIZE;
- if (getenv ("MEMPROF_BUFFER_SIZE") != NULL)
+ if (getenv ("MEMUSAGE_BUFFER_SIZE") != NULL)
{
- buffer_size = atoi (getenv ("MEMPROF_BUFFER_SIZE"));
+ buffer_size = atoi (getenv ("MEMUSAGE_BUFFER_SIZE"));
if (buffer_size == 0 || buffer_size > DEFAULT_BUFFER_SIZE)
buffer_size = DEFAULT_BUFFER_SIZE;
}
/* Possibly enable timer-based stack pointer retrieval. */
- if (getenv ("MEMPROF_NO_TIMER") == NULL)
+ if (getenv ("MEMUSAGE_NO_TIMER") == NULL)
{
struct sigaction act;
diff --git a/malloc/memprof.sh b/malloc/memusage.sh
index 3113f591e6..744991ff02 100755
--- a/malloc/memprof.sh
+++ b/malloc/memusage.sh
@@ -1,5 +1,5 @@
#! @BASH@
-# Copyright (C) 1999 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
@@ -18,24 +18,24 @@
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-memprofso=@LIBDIR@/libmemprof.so
-memprofstat=@BINDIR@/memprofstat
+memusageso=@LIBDIR@/libmemusage.so
+memusagestat=@BINDIR@/memusagestat
# Print usage message.
do_usage() {
- echo >&2 $"Try \`memprof --help' for more information."
+ echo >&2 $"Try \`memusage --help' for more information."
exit 1
}
# Message for missing argument.
do_missing_arg() {
- echo >&2 $"memprof: option \`$1' requires an argument"
+ echo >&2 $"memusage: option \`$1' requires an argument"
do_usage
}
# Print help message
do_help() {
- echo $"Usage: memprof [OPTION]... PROGRAM [PROGRAMOPTION]...
+ echo $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...
Profile memory usage of PROGRAM.
-n,--progname=NAME Name of the program file to profile
@@ -64,8 +64,8 @@ Report bugs using the \`glibcbug' script to <bugs@gnu.org>."
}
do_version() {
- echo 'memprof (GNU libc) @VERSION@'
- echo $"Copyright (C) 1999 Free Software Foundation, Inc.
+ echo 'memusage (GNU libc) @VERSION@'
+ echo $"Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper."
@@ -82,7 +82,7 @@ while test $# -gt 0; do
do_help
;;
--us | --usa | --usag | --usage)
- echo $"Syntax: memprof [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]
+ echo $"Syntax: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]
[--buffer=SIZE] [--no-timer] [--time-based] [--total]
[--title=STRING] [--x-size=SIZE] [--y-size=SIZE]
PROGRAM [PROGRAMOPTION]..."
@@ -135,43 +135,43 @@ while test $# -gt 0; do
notimer=yes
;;
-t | --tim | --time | --time- | --time-b | --time-ba | --time-bas | --time-base | --time-based)
- memprofstat_args="$memprofstat_args -t"
+ memusagestat_args="$memusagestat_args -t"
;;
-T | --to | --tot | --tota | --total)
- memprofstat_args="$memprofstat_args -T"
+ memusagestat_args="$memusagestat_args -T"
;;
--tit | --titl | --title)
if test $# -eq 1; then
do_missing_arg $1
fi
shift
- memprofstat_args="$memprofstat_args -s $1"
+ memusagestat_args="$memusagestat_args -s $1"
;;
--tit=* | --titl=* | --title=*)
- memprofstat_args="$memprofstat_args -s ${1##*=}"
+ memusagestat_args="$memusagestat_args -s ${1##*=}"
;;
-x | --x | --x- | --x-s | --x-si | --x-siz | --x-size)
if test $# -eq 1; then
do_missing_arg $1
fi
shift
- memprofstat_args="$memprofstat_args -x $1"
+ memusagestat_args="$memusagestat_args -x $1"
;;
--x=* | --x-=* | --x-s=* | --x-si=* | --x-siz=* | --x-size=*)
- memprofstat_args="$memprofstat_args -x ${1##*=}"
+ memusagestat_args="$memusagestat_args -x ${1##*=}"
;;
-y | --y | --y- | --y-s | --y-si | --y-siz | --y-size)
if test $# -eq 1; then
do_missing_arg $1
fi
shift
- memprofstat_args="$memprofstat_args -y $1"
+ memusagestat_args="$memusagestat_args -y $1"
;;
--y=* | --y-=* | --y-s=* | --y-si=* | --y-siz=* | --y-size=*)
- memprofstat_args="$memprofstat_args -y ${1##*=}"
+ memusagestat_args="$memusagestat_args -y ${1##*=}"
;;
--p | --p=* | --t | --t=* | --ti | --ti=* | --u)
- echo >&2 $"memprof: option \`${1##*=}' is ambiguous"
+ echo >&2 $"memusage: option \`${1##*=}' is ambiguous"
do_usage
;;
--)
@@ -180,7 +180,7 @@ while test $# -gt 0; do
break
;;
--*)
- echo >&2 $"memprof: unrecognized option \`$1'"
+ echo >&2 $"memusage: unrecognized option \`$1'"
do_usage
;;
*)
@@ -198,35 +198,35 @@ if test $# -eq 0; then
fi
# This will be in the environment.
-add_env="LD_PRELOAD=$memprofso"
+add_env="LD_PRELOAD=$memusageso"
# Generate data file name.
datafile=
if test -n "$data"; then
datafile="$data"
elif test -n "$png"; then
- datafile=$(mktemp ${TMPDIR:-/tmp}/memprof.XXXXXX 2> /dev/null)
+ datafile=$(mktemp ${TMPDIR:-/tmp}/memusage.XXXXXX 2> /dev/null)
if test $? -ne 0; then
# Lame, but if there is no `mktemp' program the user cannot expect more.
if test "$RANDOM" != "$RANDOM"; then
- datafile=${TMPDIR:-/tmp}/memprof.$RANDOM
+ datafile=${TMPDIR:-/tmp}/memusage.$RANDOM
else
- datafile=${TMPDIR:-/tmp}/memprof.$$
+ datafile=${TMPDIR:-/tmp}/memusage.$$
fi
fi
fi
if test -n "$datafile"; then
- add_env="$add_env MEMPROF_OUTPUT=$datafile"
+ add_env="$add_env MEMUSAGE_OUTPUT=$datafile"
fi
# Set buffer size.
if test -n "$buffer"; then
- add_env="$add_env MEMPROF_BUFFER_SIZE=$buffer"
+ add_env="$add_env MEMUSAGE_BUFFER_SIZE=$buffer"
fi
# Disable timers.
if test -n "$notimer"; then
- add_env="$add_env MEMPROF_NO_TIMER=yes"
+ add_env="$add_env MEMUSAGE_NO_TIMER=yes"
fi
# Execute the program itself.
@@ -241,7 +241,7 @@ if test -n "$png" -a -n "$datafile" -a -s "$datafile"; then
*.png) ;;
*) png="$png.png" ;;
esac
- $memprofstat $memprofstat_args "$datafile" "$png"
+ $memusagestat $memusagestat_args "$datafile" "$png"
fi
if test -z "$data" -a -n "$datafile"; then
diff --git a/malloc/memprofstat.c b/malloc/memusagestat.c
index 638b3beb73..1da0ff0ce9 100644
--- a/malloc/memprofstat.c
+++ b/malloc/memusagestat.c
@@ -1,5 +1,5 @@
/* Generate graphic from memory profiling data.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -191,7 +191,7 @@ main (int argc, char *argv[])
if (maxsize_heap == 0 && maxsize_stack == 0)
{
- /* The program aborted before memprof was able to write the
+ /* The program aborted before memusage was able to write the
information about the maximum heap and stack use. Repair
the file now. */
struct entry next;