buffer8848 / gperftools

Automatically exported from code.google.com/p/gperftools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cpuprofiler doesn't catch stack frames on linux with gcc 4.1.2/x86

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. configure && make on debian etch/x86 with gcc 4.1.2 installed
2. ./profiler1_unittest 1 1 a
3. ./src/pprof .libs/profiler a --dot

I was expecting something like this (both nodes and edges):
Removing 0xb7f2d50c from all stack traces.
digraph "./.libs/profiler1_unittest; 23 samples" {
node [width=0.375,height=0.25];
Legend
[shape=box,fontsize=24,shape=plaintext,label="./.libs/profiler1_unittest\lTotal
samples: 23\lFocusing on: 23\lDropped nodes with <= 0 abs(samples)\lDropped
edges with <= 0 samples\l"];
N1 [label="snprintf\n0 (0.0%)\rof 23 (100.0%)\r",shape=box,fontsize=8.0];
N2 [label="__do_global_dtors_aux\n0 (0.0%)\rof 23
(100.0%)\r",shape=box,fontsize=8.0];
N3 [label="__libc_start_main\n0 (0.0%)\rof 23
(100.0%)\r",shape=box,fontsize=8.0];
N4 [label="test_main_thread\n0 (0.0%)\rof 23
(100.0%)\r",shape=box,fontsize=8.0];
N5 [label="vsnprintf\n3 (13.0%)\rof 23 (100.0%)\r",shape=box,fontsize=26.1];
N6 [label="vfprintf\n8 (34.8%)\rof 17 (73.9%)\r",shape=box,fontsize=37.5];
N7 [label="Mutex\nUnlock\n0 (0.0%)\rof 12 (52.2%)\r",shape=box,fontsize=8.0];
N8 [label="main\n0 (0.0%)\rof 11 (47.8%)\r",shape=box,fontsize=8.0];
N9 [label="_IO_default_xsputn\n6 (26.1%)\r",shape=box,fontsize=33.5];
N10 [label="_IO_str_overflow\n2 (8.7%)\r",shape=box,fontsize=22.7];
N11 [label="_IO_funlockfile\n1 (4.3%)\r",shape=box,fontsize=18.4];
N12 [label="cuserid\n1 (4.3%)\r",shape=box,fontsize=18.4];
N13 [label="h_errno\n1 (4.3%)\r",shape=box,fontsize=18.4];
N14 [label="_IO_sgetn\n1 (4.3%)\r",shape=box,fontsize=18.4];
N14 -> N14 [label=1, weight=1, style="setlinewidth(0.260870)"];
N5 -> N10 [label=2, weight=1, style="setlinewidth(0.521739)"];
N5 -> N6 [label=17, weight=7, style="setlinewidth(2.000000)"];
N3 -> N8 [label=11, weight=5, style="setlinewidth(2.000000)"];
N6 -> N13 [label=1, weight=1, style="setlinewidth(0.260870)"];
N7 -> N4 [label=12, weight=5, style="setlinewidth(2.000000)"];
N1 -> N5 [label=23, weight=8, style="setlinewidth(2.000000)"];
N6 -> N11 [label=1, weight=1, style="setlinewidth(0.260870)"];
N8 -> N4 [label=11, weight=5, style="setlinewidth(2.000000)"];
N3 -> N7 [label=12, weight=5, style="setlinewidth(2.000000)"];
N2 -> N3 [label=23, weight=8, style="setlinewidth(2.000000)"];
N5 -> N14 [label=1, weight=1, style="setlinewidth(0.260870)"];
N4 -> N1 [label=23, weight=8, style="setlinewidth(2.000000)"];
N6 -> N12 [label=1, weight=1, style="setlinewidth(0.260870)"];
N6 -> N9 [label=6, weight=3, style="setlinewidth(1.565217)"];
}

But got this (only info about nodes):

digraph "./.libs/profiler1_unittest; 23 samples" {
node [width=0.375,height=0.25];
Legend
[shape=box,fontsize=24,shape=plaintext,label="./.libs/profiler1_unittest\lTotal
samples: 23\lFocusing on: 23\lDropped nodes with <= 0 abs(samples)\lDropped
edges with <= 0 samples\l"];
N1 [label="vfprintf\n9 (39.1%)\r",shape=box,fontsize=39.3];
N2 [label="_IO_default_xsputn\n4 (17.4%)\r",shape=box,fontsize=28.9];
N3 [label="_IO_str_overflow\n3 (13.0%)\r",shape=box,fontsize=26.1];
N4 [label="test_main_thread\n2 (8.7%)\r",shape=box,fontsize=22.7];
N5 [label="_IO_sgetn\n2 (8.7%)\r",shape=box,fontsize=22.7];
N6 [label="_IO_funlockfile\n1 (4.3%)\r",shape=box,fontsize=18.4];
N7 [label="cuserid\n1 (4.3%)\r",shape=box,fontsize=18.4];
N8 [label="_init\n1 (4.3%)\r",shape=box,fontsize=18.4];
}

Tested on both gpt-1.2 and gpt-1.3
Patch attached.

Original issue reported on code.google.com by alexey.v...@gmail.com on 16 Jun 2009 at 9:31

Attachments:

Oops, it looks like my previous fix to work around __builtin_frame_address bugs 
was
incomplete, as you noticed.  I'll have this fixed for the next release.

Original comment by csilv...@gmail.com on 16 Jun 2009 at 6:28

  • Changed state: Started

Original comment by csilv...@gmail.com on 16 Jun 2009 at 6:28

  • Added labels: Priority-Medium, Type-Defect
This should be fixed in perftools 1.4, just released.

Original comment by csilv...@gmail.com on 11 Sep 2009 at 6:55

  • Changed state: Fixed