On Wed, Feb 18, 2015 at 10:44:27AM +0100, Josef Weidendorfer wrote:
> Am 17.02.2015 um 21:22 schrieb Raul Garcia:
> > I am a new user, I am doing a "hello world" test of Valgrind but i keep
> > hitting this error:
> > ...
> > 2,709 *???*:getenv [/home/otro/arm_emulator/hello_x86]
> 
> The "???" are not really any errors, but a sign that for these functions,
> valgrind could not locate debug information providing a source file name.
> 
> > This is the command that I used, as you can see I used -g and -O0
> > options as suggested.
> > 
> > $ gcc -static -g -O0 hello.c -o hello_x86
> 
> getenv above is from glibc, and you seem not to have debug information
> installed for the statically linkable glibc.
> "-O0" or "-g" does not help here, because the issue is with an already
> compiled library.
> Does it work if you remove "-static"? I have no idea if Ubuntu provides
> debug info for libc.a ...

Debian do provides, so I guess that ubuntu too:
libc6-dev: /usr/lib/x86_64-linux-gnu/libc.a

> 
> > But when I try to see the analysis with callgrind I get:
> > 
> >     Ir
> > --------------------------------------------------------------------------------
> > 11,737  PROGRAM TOTALS
> > 
> > --------------------------------------------------------------------------------
> >    Ir  file:function
> > --------------------------------------------------------------------------------
> > 2,709  ???:getenv [/home/otro/arm_emulator/hello_x86]
> > 1,133  ???:_int_malloc [/home/otro/arm_emulator/hello_x86]
> >   813  ???:intel_check_word [/home/otro/arm_emulator/hello_x86]
> >   792  ???:malloc_consolidate [/home/otro/arm_emulator/hello_x86]
> >   783  ???:_IO_file_overflow [/home/otro/arm_emulator/hello_x86]
> >   555  ???:strncmp [/home/otro/arm_emulator/hello_x86]
> >   435  ???:ptmalloc_init.part.7 [/home/otro/arm_emulator/hello_x86]
> >   361  ???:(below main) [/home/otro/arm_emulator/hello_x86]
> >   342  ???:_IO_default_xsputn [/home/otro/arm_emulator/hello_x86]
> >   311  ???:_dl_init_paths [/home/otro/arm_emulator/hello_x86]
> > 
> > And I cant see the cost of the functions . What can be the problem? Some
> > logs are attached, i hope they are helpful.
> 
> Self cost is there.
> To see inclusive costs, you need to use "callgrind_annotate
> --inclusive=yes ...".
> And "--tree=both" shows a butterfly output of the call graph.
> 
> I would suggest do use kcachegrind/qcachegrind to visualize callgrind
> results.
> 
> Josef

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to