mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH perf/core 3/3] perf-probe: Fix to probe on gcc generated functions in modules
Date: Thu, 5 Jan 2017 23:16:30 +0900	[thread overview]
Message-ID: <20170105231630.f12a63432335b659d467fe14@kernel.org> (raw)
In-Reply-To: <20170105202019.4764dbb16f4076304bc5de3c@kernel.org>

On Thu, 5 Jan 2017 20:20:19 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Wed, 4 Jan 2017 11:48:56 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Em Wed, Jan 04, 2017 at 12:31:39PM +0900, Masami Hiramatsu escreveu:
> > > Fix to probe on gcc generated functions on modules. Since
> > > probing on a module is based on its symbol name, it should
> > > be adjusted on actual symbols.
> > > 
> > > E.g. without this fix, perf probe shows probe definition
> > > on non-exist symbol as below.
> > >   -----
> > >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -F in_range*
> > >   in_range.isra.12
> > >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
> > >   p:probe/in_range nf_nat:in_range+0
> > >   -----
> > > With this fix, perf probe correctly shows a probe on
> > > gcc-generated symbol.
> > >   -----
> > >   $ perf probe -m build-x86_64/net/netfilter/nf_nat.ko -D in_range
> > >   p:probe/in_range nf_nat:in_range.isra.12+0
> > >   -----
> > 
> > Tested this one on a x86-64 fedora25 system, applied all three.
> > 
> > As always, please take a look at the patch when sent to Ingo, I usually
> > put some committer notes there, in this case I put the test steps I
> > performed, using e1000e.ko and e1000_flash_cycle_ich8lan.constprop.22
> > 
> > BTW, it would be cool if...
> > 
> > Oops, I retract that, while I was testing what I was went to ask you to
> > implement, I saw that this last patch broke this use case:
> > 
> > [root@jouet ~]# perf probe -m e1000e e1000_xmit_frame
> > Failed to get ELF symbols for e1000e
> > Probe point 'e1000_xmit_frame' not found.
> >   Error: Failed to add events.
> > [root@jouet ~]#
> 
> Oops, I missed that case.
> However, when I trided to fix that on fedora25,
> 
> $ perf probe -m i915 -vD assert_plane
> probe-definition(0): assert_plane
> symbol:assert_plane file:(null) line:0 offset:0 return:0 lazy:(null)
> 0 arguments
> No kprobe blacklist support, ignored
> Failed to get build-id from i915.
> Cache open error: -1
> Open Debuginfo file: /lib/modules/4.8.15-300.fc25.x86_64/kernel/drivers/gpu/drm/i915/i915.ko.xz
> Try to find probe point from debuginfo.
> Matched function: assert_plane [6fb806]
> found inline addr: 0x886a0
> Probe point found: assert_plane+0
> Found 1 probe_trace_events.
> text offset: 10030
> Failed to get ELF symbols for /lib/modules/4.8.15-300.fc25.x86_64/kernel/drivers/gpu/drm/i915/i915.ko.xz
> Post processing failed or all events are skipped. (-22)
> Probe point 'assert_plane' not found.
>   Error: Failed to add events. Reason: No such file or directory (Code: -2)
> 
> As far as I can see, elfutils's libdw supports compressed file, but
> libelf API (perf's API) seems not supporting it. This results in
> succeeding opening debuginfo, but failing ELF symbols.

Sorry, this is my fault, perf's map already supported that.
Anyway, I can get ELF headers from debuginfo. However, I'm still
trying to fix an text section offset issue in modules.

Thanks,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2017-01-05 14:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  3:27 [PATCH perf/core 0/3] perf-probe: Fix offline module and cross-arch support Masami Hiramatsu
2017-01-04  3:29 ` [PATCH perf/core 1/3] perf-probe: Fix --funcs to show correct symbols for offline module Masami Hiramatsu
2017-01-05  7:54   ` [tip:perf/urgent] perf probe: " tip-bot for Masami Hiramatsu
2017-01-04  3:30 ` [PATCH perf/core 2/3] perf-probe: Fix to probe on gcc generated symbols for offline kernel Masami Hiramatsu
2017-01-05  7:54   ` [tip:perf/urgent] perf probe: " tip-bot for Masami Hiramatsu
2017-01-04  3:31 ` [PATCH perf/core 3/3] perf-probe: Fix to probe on gcc generated functions in modules Masami Hiramatsu
2017-01-04 14:48   ` Arnaldo Carvalho de Melo
2017-01-05 11:20     ` Masami Hiramatsu
2017-01-05 14:16       ` Masami Hiramatsu [this message]
2017-01-05 15:30       ` Arnaldo Carvalho de Melo
2017-01-05 18:47         ` Arnaldo Carvalho de Melo
2017-01-06  2:16           ` Masami Hiramatsu
2017-01-06 16:22           ` Masami Hiramatsu
2017-01-06 18:17             ` Arnaldo Carvalho de Melo
2017-01-07  1:50               ` Masami Hiramatsu

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=20170105231630.f12a63432335b659d467fe14@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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

Powered by JetHome