Skip to contentSkip to conversation

Memory Profiling Tool

DISCUSSION [email protected] 6 participants 10 messages Sep 2, 2003 – Sep 5, 2003

lore
Share & tools
lore
#1 lore raw
Quoted 2 lines · [email protected] wrote:

Is there any memory profiling and leak detection tool available which works for both PPC and X86??

Here's what I know about.
1. There's a utility built into glibc which may be of some help:
http://www.gnu.org/manual/glibc-2.2.5/html_node/Allocation-Debugging.html#Allocation%20Debugging
but it's a bit minimal.

2. x86 only - valgrind, of course. God's gift to x86 programmers. Shame it's not been ported to ppc.

3. libmudflap. This is very promising; see
http://people.redhat.com/dnovillo/Papers/nordu2003-slides.pdf
http://www.linux.org.uk/~ajh/gcc/gccsummit-2003-proceedings.pdf
However, it's part of the SSA branch of gcc-3.4, so you'll need to use something like http://kegel.com/crosstool to build it.
I am hoping to try this out on ppc sometime, but haven't yet. FWIW, it's provided with Red Hat's taroon beta, so it must be getting close to usable.

If you're debugging c++, you should also read
http://gcc.gnu.org/onlinedocs/libstdc++/debug.html
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to [email protected]
Quoted 4 lines

Is there any memory profiling and leak detection tool available which works for both PPC and X86??

bgcc - bounds checking gcc - its a patch to gcc

the output will look something like this but can be tuned with compile time options:

Bounds Checking GCC v gcc-3.2.2-3.1 Copyright (C) 1995 Richard W.M. Jones Bounds Checking comes with ABSOLUTELY NO WARRANTY. For details see file COPYING' that should have come with the source to this program. Bounds Checking is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING' for details. For more information, set GCC_BOUNDS_OPTS to `-help'
Bounds library call frequency statistics:

  Calls to push, pop, param function:        1, 1, 0
  Calls to add, delete stack:                1, 1
  Calls to add, delete heap:                 1, 0

^^^^
malloc but no free..

  Calls to check pointer +/- integer:        0
  Calls to check array references:           0
  Calls to check pointer differences:        0
  Calls to check object references:          0
  Calls to check component references:       0
  Calls to check truth, falsity of pointers: 0, 0
  Calls to check <, >, <=, >= of pointers:   0
  Calls to check ==, != of pointers:         0
  Calls to check p++, ++p, p--, --p:         0, 0, 0, 0
  References to unchecked static, stack:     0, 0

hofrat

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

Is there any tool like purify(memory leak check tool) for Embedded Linux/ELDK environment

In reply to Dan Kegel

Dear all,

Is there any tool like purify(memory leak check tool) for Embedded Linux/ELDK environment?

Best Regards,
John Zhou

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
In reply to Der Herr Hofrat
Quoted 8 lines · Der Herr Hofrat
Quoted 2 lines

Is there any memory profiling and leak detection tool available which works for both PPC and X86??

bgcc - bounds checking gcc - its a patch to gcc

the output will look something like this but can be tuned with compile time options:

Bounds Checking GCC v gcc-3.2.2-3.1 Copyright (C) 1995 Richard W.M. Jones ...

Hey! I didn't know that was still alive! Thanks for the tip! There's even a version for gcc-3.3.1 at
http://web.inter.nl.net/hcc/Haj.Ten.Brugge/

- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw

display top CPU processes top tool

Hi, all

I'm using "top" tool to display top CPU processes and system running information in my Embedded Linux based on PowerPC. But, when I run "top" command in prompt #, it's coming on:

# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=ansi
#
# top
top: Unknown terminal "ansi" in $TERM
#

I changed to :

# export TERM=VT100
# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=VT100
# top
top: Unknown terminal "VT100" in $TERM
#

Another question:

How to use "top" with option to save cpu information to a log file?

Thanks for any help.

John Zhou

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw

Re: display top CPU processes top tool

Do you have a /etc/TERMCAP ?

Quoted 37 lines · John Zhou

Hi, all

I'm using "top" tool to display top CPU processes and system running information in my Embedded Linux based on PowerPC. But, when I run "top" command in prompt #, it's coming on:

# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=ansi
#
# top
top: Unknown terminal "ansi" in $TERM
#

I changed to :

# export TERM=VT100
# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=VT100
# top
top: Unknown terminal "VT100" in $TERM
#
Quoted 8 lines

Another question:

How to use "top" with option to save cpu information to a log file?

Thanks for any help.

John Zhou

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#7 lore raw

RE: display top CPU processes top tool

Yes. I have a /etc/TERMCAP. But it's still failed. need other changes ?

Thanks for your email.

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Jaap-Jan Boor
Sent: Friday, September 05, 2003 5:02 PM
To: [email protected]
Cc: [email protected]
Subject: Re: display top CPU processes top tool

Do you have a /etc/TERMCAP ?

Quoted 37 lines · John Zhou

Hi, all

I'm using "top" tool to display top CPU processes and system running information in my Embedded Linux based on PowerPC. But, when I run "top" command in prompt #, it's coming on:

# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=ansi
#
# top
top: Unknown terminal "ansi" in $TERM
#

I changed to :

# export TERM=VT100
# set
PS2=>
PS1=#
IFS=
USER=root
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOME=/
TERM=VT100
# top
top: Unknown terminal "VT100" in $TERM
#
Quoted 8 lines

Another question:

How to use "top" with option to save cpu information to a log file?

Thanks for any help.

John Zhou

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#8 lore raw

Re: display top CPU processes top tool

Quoted 8 lines · John Zhou
Quoted 5 lines · Jaap-Jan
Quoted 2 lines · John Zhou

top: Unknown terminal "ansi" in $TERM
top: Unknown terminal "VT100" in $TERM

Do you have a /etc/TERMCAP ?

Yes. I have a /etc/TERMCAP. But it's still failed. need other changes ?

Use strace to see what it's looking for.
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#9 lore raw

Re: display top CPU processes top tool

I bet that top is linked with ncurses instead of termcap. As such look at /usr/share/terminfo on the target and make sure the appropriate directories and terminal emulations are there.

--Mark

Quoted 17 lines · Dan Kegel
Quoted 4 lines · John Zhou
Quoted 2 lines · Jaap-Jan

On vrijdag, sep 5, 2003, at 10:26 Europe/Amsterdam, John Zhou wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

top: Unknown terminal "ansi" in $TERM
top: Unknown terminal "VT100" in $TERM

Do you have a /etc/TERMCAP ?

Yes. I have a /etc/TERMCAP. But it's still failed. need other changes ?

Quoted 13 lines

Use strace to see what it's looking for.
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/