linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: HOUSSEN Franck <fghoussen@gmail.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: perf-probe : error "Rebuild with -g, or install an appropriate debuginfo package"
Date: Fri, 2 Dec 2016 11:40:15 +0100	[thread overview]
Message-ID: <CABvthirubZd+MfSy8PUEXkt1GCveY1HxS7X-OWMpncVzjsU1kg@mail.gmail.com> (raw)
In-Reply-To: <20161201142624.2041eb5a2ed866f817dd7566@kernel.org>

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

      reply	other threads:[~2016-12-02 10:40 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
2016-12-02 10:40   ` HOUSSEN Franck [this message]

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=CABvthirubZd+MfSy8PUEXkt1GCveY1HxS7X-OWMpncVzjsU1kg@mail.gmail.com \
    --to=fghoussen@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mhiramat@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).