Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbbKZDXu (ORCPT ); Wed, 25 Nov 2015 22:23:50 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:22586 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbbKZDXs (ORCPT ); Wed, 25 Nov 2015 22:23:48 -0500 Message-ID: <56567AE3.9050205@huawei.com> Date: Thu, 26 Nov 2015 11:22:11 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: , , Masami Hiramatsu , Namhyung Kim , Zefan Li , Subject: Re: [PATCH] perf probe: Adjust dso->long_name for offline module References: <1448451059-156220-1-git-send-email-wangnan0@huawei.com> <20151125193532.GC2945@kernel.org> In-Reply-To: <20151125193532.GC2945@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.56567B20.0029,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9eaa1640a3b0b2df49bd5be7c3bc2b45 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2376 Lines: 56 On 2015/11/26 3:35, Arnaldo Carvalho de Melo wrote: > Em Wed, Nov 25, 2015 at 11:30:59AM +0000, Wang Nan escreveu: >> If libelf unable to open debuginfo for an offline module but the ko has >> symtab, something unexpected may happen. >> >> # rm -rf ~/.debug/ >> # mv /usr/lib64/elfutils/libebl_x86_64.so{,.bak} >> # ./perf probe -m /home/wangnan/kmodule/mymodule.ko my_func >> [mymodule] with build id 326ab42550ef3d24944f53c817533728367effeb not found, continuing without symbols >> Failed to find symbol my_func in /home/wangnan/kmodule/mymodule.ko > Understood, since we are giving the path to that module, we can, if its > build-id matches the one for the online module, use it, is that the > case, i.e. do we check, int his scenario, that the build-id matches? Please see my test result in v2 patch [1]. In symsrc__init() build-id would be checked. [1] http://lkml.kernel.org/r/1448507949-187812-1-git-send-email-wangnan0@huawei.com # ./perf probe -m ./mymodule.ko my_func Added new event: probe:my_func (on my_func in /home/wangnan/kmodule/mymodule.ko) You can now use it in all perf tools, such as: perf record -e probe:my_func -aR sleep 1 # ./perf probe -d '*' Removed event: probe:my_func # mv ./mymodule.{ko,.bak} # mv ./moduleb.ko mymodule.ko # ./perf probe -m ./mymodule.ko my_func /home/wangnan/kmodule/mymodule.ko with build id 326ab42550ef3d24944f53c817533728367effeb not found, continuing without symbols Failed to find symbol my_func in /home/wangnan/kmodule/mymodule.ko Error: Failed to add events. # ./perf probe -v -m ./mymodule.ko my_func probe-definition(0): my_func symbol:my_funcfile:(null) line:0 offset:0 return:0 lazy:(null) 0 arguments Could not open debuginfo. Try to use symbols. symsrc__init: build id mismatch for /home/wangnan/kmodule/mymodule.ko. /home/wangnan/kmodule/mymodule.ko with build id 326ab42550ef3d24944f53c817533728367effeb not found, continuing without symbols Failed to find symbol my_func in /home/wangnan/kmodule/mymodule.ko Error: Failed to add events. Reason: No such file or directory (Code: -2) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/