From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937079AbdAEOQu (ORCPT ); Thu, 5 Jan 2017 09:16:50 -0500 Received: from mail.kernel.org ([198.145.29.136]:58936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762030AbdAEOQl (ORCPT ); Thu, 5 Jan 2017 09:16:41 -0500 Date: Thu, 5 Jan 2017 23:16:30 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim Subject: Re: [PATCH perf/core 3/3] perf-probe: Fix to probe on gcc generated functions in modules Message-Id: <20170105231630.f12a63432335b659d467fe14@kernel.org> In-Reply-To: <20170105202019.4764dbb16f4076304bc5de3c@kernel.org> References: <148350046263.19001.16486219029429895749.stgit@devbox> <148350067886.19001.17914403329655231652.stgit@devbox> <20170104144856.GL27864@kernel.org> <20170105202019.4764dbb16f4076304bc5de3c@kernel.org> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Jan 2017 20:20:19 +0900 Masami Hiramatsu wrote: > On Wed, 4 Jan 2017 11:48:56 -0300 > Arnaldo Carvalho de Melo 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