From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbbCCCjM (ORCPT ); Mon, 2 Mar 2015 21:39:12 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:51127 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529AbbCCCjK (ORCPT ); Mon, 2 Mar 2015 21:39:10 -0500 Message-ID: <54F51EC6.2040902@hitachi.com> Date: Tue, 03 Mar 2015 11:39:02 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo Cc: Naohiro Aota , Peter Zijlstra , Linux Kernel Mailing List , David Ahern , namhyung@kernel.org, Jiri Olsa , Ingo Molnar Subject: Re: [PATCH perf/core 2/4] perf-probe: Fix to handle aliased symbols in glibc References: <20150302124939.9191.33564.stgit@localhost.localdomain> <20150302124953.9191.16348.stgit@localhost.localdomain> <20150302154642.GD5538@kernel.org> In-Reply-To: <20150302154642.GD5538@kernel.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (2015/03/03 0:46), Arnaldo Carvalho de Melo wrote: > Em Mon, Mar 02, 2015 at 09:49:53PM +0900, Masami Hiramatsu escreveu: >> With this patch; >> ----- >> # ./perf probe -x /usr/lib64/libc-2.17.so -V malloc >> Available variables at malloc >> @<__libc_malloc+0> >> size_t bytes >> # ./perf probe -x /usr/lib64/libc-2.17.so -a "malloc bytes" >> Added new event: >> probe_libc:malloc (on malloc in /usr/lib64/libc-2.17.so with bytes) >> >> You can now use it in all perf tools, such as: >> >> perf record -e probe_libc:malloc -aR sleep 1 > >> Reported-by: Arnaldo Carvalho de Melo > > Humm, not working for me, after the patch: > > [root@ssdandy ~]# perf probe -x /usr/lib64/libc-2.17.so -V malloc > Available variables at malloc > @<__malloc_check_init+96> > (No matched variables) Could you run it with -v (verbose) option? > [root@ssdandy ~]# > > And then the one asking for 'bytes' to be collectd fails. > > After processing the other patches I'll try to debug this... > > [root@ssdandy ~]# cat /etc/redhat-release > Red Hat Enterprise Linux Server release 7.0 (Maipo) > [root@ssdandy ~]# rpm -q glibc glibc-debuginfo > glibc-2.17-55.el7_0.3.x86_64 > glibc-debuginfo-2.17-55.el7_0.1.x86_64 ^^^ why is this different from the glibc version?? > [root@ssdandy ~]# > [acme@ssdandy linux]$ readelf -Ws /usr/lib64/libc-2.17.so| grep malloc [...] > 4849: 0000000000080050 107 FUNC LOCAL DEFAULT 12 __malloc_check_init __malloc_check_init+96(0x60) becomes 0x80050 + 0x60 = 0x800b0 > 5351: 00000000000800c0 245 FUNC LOCAL DEFAULT 12 __malloc > 1170: 00000000000800c0 245 FUNC GLOBAL DEFAULT 12 malloc@@GLIBC_2.2.5 that is not 0x800c0, so something goes wrong when translating the address to probe point. Could you check the patch 1/4 was applied? Actually there is a bug in the routine which gets the probe point from address. 1/4 fixes it. Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com