tfzxyinhao / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

[mips backtracing] Cavium octeon mips64 don't have program address --help #403

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.download version 1.8.2 and patch, read README_mips.txt first.
2.cd google-perftools-1.8.2; patch -p1 < ../google-perftools-1.8.2-mips.patch
3.vi configure
add
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
ac_cv_func_mmap_fixed_mapped=yes

4, ./configure --host=mips64-octeon-linux-gnu
5!!, vi src/base/linuxthreads.h
   open define sys_sigprocmask and sys_sigaction
//# if defined(HAVE_RT_SIGPROCMASK)
#if 1
#  define sys_sigprocmask(a,b,c) sys_rt_sigprocmask(a, b, c, sizeof(struct 
kernel_sigset_t))
#  define sys_sigaction(a,b,c)   sys_rt_sigaction(a,b,c,sizeof(struct 
kernel_sigaction))
# endif
6, vi src/config.h
add this line
#define __MIPS64__ 1
7, make
8, cp google-perftools-1.8.2/.libs/libtcmalloc.so.0 to Cavium platform /lib64
9, mips64-octeon-linux-gnu-g++ -O0 -g heap_test2.c -o heap_test 
-Igoogle-perftools-1.8.2/src  -Igoogle-perftools-1.8.2/src/google  
-Lgoogle-perftools-1.8.2/.libs -ltcmalloc
10, run heap_test on Cavium octeon platform
  #env HEAPCHECK=normal ./heap_test   #this sample heap_test run at least 10secs.
11, cat /tmp/heap_test.18884._main_-end.heap
    !!!!!!!!!!!!!!!!!!!!!!
   heap profile @ don't have any program address!
    !!!!!!!!!!!!!!!!!!!!!!
heap profile:     10:      200 [    10:      200] @ heapprofile
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @
     1:       20 [     1:       20] @

MAPPED_LIBRARIES:
120000000-120002000 r-xp 00000000 00:00 12320878    /disk/heap_test
120101000-120102000 rw-p 00001000 00:00 12320878    /disk/heap_test
120102000-120582000 rwxp 120102000 00:00 0           [heap]
5555556000-5555572000 r-xp 00000000 00:00 2909        /lib64/ld-2.4.so
5555572000-5555588000 rw-p 5555572000 00:00 0           
5555598000-55555f8000 rw-p 5555598000 00:00 0           
5555671000-5555673000 rw-p 0001b000 00:00 2909        /lib64/ld-2.4.so
...

What is the expected output? What do you see instead?
heap profile @ have some program address!

What version of the product are you using? On what operating system?
I use google-perftools-1.8.2 on Cavium octeon 58xx platform.

Please provide any additional information below.

Original issue reported on code.google.com by xuxin2...@gmail.com on 16 Feb 2012 at 3:46

Attachments:

GoogleCodeExporter commented 9 years ago
any one help? 

Original comment by WangN...@gmail.com on 28 Feb 2012 at 1:56

GoogleCodeExporter commented 9 years ago
I suspect you are going to need --enable-frame-pointers and possibly libunwind. 
Also, try without any optimizations and full debugging symbols:

    -g -O0

Original comment by chapp...@gmail.com on 2 Mar 2012 at 4:25

GoogleCodeExporter commented 9 years ago
Any update here. If not I am going to close this one off.

Original comment by chapp...@gmail.com on 11 Mar 2013 at 2:09

GoogleCodeExporter commented 9 years ago
mips doesn't have standard way to grab backtraces. On mailing list I've seen 
people reporting that -fexceptions and libunwind seem to work (with yet to be 
merged patches).

Original comment by alkondratenko on 14 Sep 2013 at 8:20

GoogleCodeExporter commented 9 years ago
Hi,

I'm observing the same issue on on cavium octeon mips64

Here are the steps which i tried,

1. Compiled libunwind for mips64-octeon-linux-gnu with the following options,
./configure --host=mips64-octeon-linux-gnu CC=mips64-octeon-linux-gnu-gcc
make

2. Compiled libtcmalloc for mips64-octeon-linux-gnu with the following options,
./configure --host=mips64-octeon-linux-gnu --enable-libunwind=yes 
--enable-frame-pointers CC=mips64-octeon-linux-gnu-gcc 
LDFLAGS=-L../libunwind-1.1/src/.libs LIBS=-lunwind 
CPPFLAGS=-I../libunwind-1.1/include
make

3. Compiled a sample program which does a malloc(100) and new int[200] as 
follows,
mips64-octeon-linux-gnu-g++ temp.c -L ./.libs -L ../libunwind-1.1/src/.libs/ 
-ltcmalloc -lunwind

4. The program compiled successfully and on execution with HEAPCHECK=normal, i 
see the following output,
heap profile:      2:      900 [     2:      900] @ heapprofile
     1:      100 [     1:      100] @
     1:      800 [     1:      800] @

MAPPED_LIBRARIES:
...

Output from the HEAP checker displays that 100 and 800 bytes have been leaked 
but does not print any address where the allocation is done.
On using pprof it says "No nodes to print"

Kindly suggest.

Regards

Original comment by lokna...@gmail.com on 25 Feb 2015 at 9:39

GoogleCodeExporter commented 9 years ago
Please find the source and compiler version details,

gperftools-2.4.tar.gz
libunwind-1.1.tar.gz
mips64-octeon-linux-gnu-g++ (Cavium Inc. Version: 2_3_0 build 116) 4.3.3

Original comment by lokna...@gmail.com on 25 Feb 2015 at 9:47

GoogleCodeExporter commented 9 years ago
Please suggest..

Original comment by lokna...@gmail.com on 26 Feb 2015 at 3:47

GoogleCodeExporter commented 9 years ago
Any help??

Original comment by lokna...@gmail.com on 4 Mar 2015 at 5:40

GoogleCodeExporter commented 9 years ago
Is anybody willing to help here?

Original comment by lokna...@gmail.com on 12 Mar 2015 at 12:51