From: Masami Hiramatsu <mhiramat@kernel.org>
To: HOUSSEN Franck <fghoussen@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package"
Date: Thu, 1 Dec 2016 14:26:24 +0900 [thread overview]
Message-ID: <20161201142624.2041eb5a2ed866f817dd7566@kernel.org> (raw)
In-Reply-To: <CABvthiqmUuGqcDU6LQRJhsPiic4-qePRx8wJtMoj+D+ihjAVdg@mail.gmail.com>
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>
next prev parent reply other threads:[~2016-12-01 5:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2016-12-02 10:40 ` HOUSSEN Franck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161201142624.2041eb5a2ed866f817dd7566@kernel.org \
--to=mhiramat@kernel.org \
--cc=fghoussen@gmail.com \
--cc=linux-perf-users@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).