* perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package"
@ 2016-11-30 13:49 HOUSSEN Franck
2016-12-01 5:26 ` Masami Hiramatsu
0 siblings, 1 reply; 3+ messages in thread
From: HOUSSEN Franck @ 2016-11-30 13:49 UTC (permalink / raw)
To: linux-perf-users
I compiled myApp.cpp (that contains a function named myFunction) with:
~>mpic++ -O2 -ggdb -fno-omit-frame-pointer -o myApp myApp.cpp
When I try to probe a function from the myApp binary, I get:
~> sudo perf probe --exe ./myApp --add "myFunction:2"
The /home/path/to/myApp file has no debug information.
Rebuild with -g, or install an appropriate debuginfo package.
Error: Failed to add events.
... -g has been set a t compile time and libelf (and libelf-dev) seems
to be installed:
~> dpkg -l *elf*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version
Architecture Description
+++-=====================================-=======================-===================
un elf-binutils <none>
<none> (no description available)
un libelf <none>
<none> (no description available)
ii libelf-dev:amd64 0.166-2.2
amd64 libelf1 development libraries and header files
un libelf0 <none>
<none> (no description available)
ii libelf1:amd64 0.166-2.2
amd64 library to read and write ELF files
ii libelf1:i386 0.166-2.2 i386
library to read and write ELF files
rc libelfg0:amd64 0.8.13-5
amd64 an ELF object file access library
un libelfg0-dev <none>
<none> (no description available)
I googled that without any relevant answer... Could somebody help me
on this ? What's wrong ?
Franck
PS : When I do that
~>sudo perf probe --exe ./myApp --add "myFunction"
Added new event:
probe_myApp:myFunction (on myFunction in /home/path/to/myApp)
It works !?... I need to place the tracepoint at the second line below
the entry of myFunction => replacing "myFunction" with "myFunction:2"
does not work ! Why ?...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package"
2016-11-30 13:49 perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package" HOUSSEN Franck
@ 2016-12-01 5:26 ` Masami Hiramatsu
2016-12-02 10:40 ` HOUSSEN Franck
0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2016-12-01 5:26 UTC (permalink / raw)
To: HOUSSEN Franck; +Cc: linux-perf-users
On Wed, 30 Nov 2016 14:49:09 +0100
HOUSSEN Franck <fghoussen@gmail.com> wrote:
> I compiled myApp.cpp (that contains a function named myFunction) with:
> ~>mpic++ -O2 -ggdb -fno-omit-frame-pointer -o myApp myApp.cpp
>
> When I try to probe a function from the myApp binary, I get:
> ~> sudo perf probe --exe ./myApp --add "myFunction:2"
> The /home/path/to/myApp file has no debug information.
> Rebuild with -g, or install an appropriate debuginfo package.
> Error: Failed to add events.
Could you run `eu-readelf -S myApp` ?
Could you also try to build your app with '-g' instead of '-ggdb'?
I guess mpic++ might generate some extened debuginfo or just ignored
the option.
>
> ... -g has been set a t compile time and libelf (and libelf-dev) seems
> to be installed:
No, libelf is not related to this issue.
[...]
> PS : When I do that
> ~>sudo perf probe --exe ./myApp --add "myFunction"
> Added new event:
> probe_myApp:myFunction (on myFunction in /home/path/to/myApp)
>
> It works !?... I need to place the tracepoint at the second line below
> the entry of myFunction => replacing "myFunction" with "myFunction:2"
> does not work ! Why ?...
Without line number, perf probe tries to find symbols from symtab in
the binary. DWARF (a.k.a. debuginfo) has much more information, like
line-to-addr, local variable assignment etc.
Thanks,
--
Masami Hiramatsu <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package"
2016-12-01 5:26 ` Masami Hiramatsu
@ 2016-12-02 10:40 ` HOUSSEN Franck
0 siblings, 0 replies; 3+ messages in thread
From: HOUSSEN Franck @ 2016-12-02 10:40 UTC (permalink / raw)
To: Masami Hiramatsu; +Cc: linux-perf-users
Installing dwarf was the solution. Now, compiling with either -g or
-ggdb, I can probe the function.
Thanks !
Franck
2016-12-01 6:26 GMT+01:00 Masami Hiramatsu <mhiramat@kernel.org>:
> On Wed, 30 Nov 2016 14:49:09 +0100
> HOUSSEN Franck <fghoussen@gmail.com> wrote:
>
>> I compiled myApp.cpp (that contains a function named myFunction) with:
>> ~>mpic++ -O2 -ggdb -fno-omit-frame-pointer -o myApp myApp.cpp
>>
>> When I try to probe a function from the myApp binary, I get:
>> ~> sudo perf probe --exe ./myApp --add "myFunction:2"
>> The /home/path/to/myApp file has no debug information.
>> Rebuild with -g, or install an appropriate debuginfo package.
>> Error: Failed to add events.
>
> Could you run `eu-readelf -S myApp` ?
> Could you also try to build your app with '-g' instead of '-ggdb'?
> I guess mpic++ might generate some extened debuginfo or just ignored
> the option.
>
>>
>> ... -g has been set a t compile time and libelf (and libelf-dev) seems
>> to be installed:
>
> No, libelf is not related to this issue.
>
> [...]
>> PS : When I do that
>> ~>sudo perf probe --exe ./myApp --add "myFunction"
>> Added new event:
>> probe_myApp:myFunction (on myFunction in /home/path/to/myApp)
>>
>> It works !?... I need to place the tracepoint at the second line below
>> the entry of myFunction => replacing "myFunction" with "myFunction:2"
>> does not work ! Why ?...
>
> Without line number, perf probe tries to find symbols from symtab in
> the binary. DWARF (a.k.a. debuginfo) has much more information, like
> line-to-addr, local variable assignment etc.
>
> Thanks,
>
>
> --
> Masami Hiramatsu <mhiramat@kernel.org>
--
Bonne journée,
Franck HOUSSEN
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-02 10:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 13:49 perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package" HOUSSEN Franck
2016-12-01 5:26 ` Masami Hiramatsu
2016-12-02 10:40 ` HOUSSEN Franck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).